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>" ;;
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"
67 if test -n "$EXEEXT"; then
68 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
69 [Does the platform use an executable suffix?])
71 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
72 [Suffix used for executables, if any.])
74 # host-specific stuff:
78 . ${srcdir}/../bfd/configure.host
88 DEMANGLER_NAME=c++filt
90 *-*-go32* | *-*-msdos*)
91 DEMANGLER_NAME=cxxfilt
93 AC_SUBST(DEMANGLER_NAME)
95 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
98 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
100 # Check whether fopen64 is available and whether _LARGEFILE64_SOURCE
101 # needs to be defined for it
102 AC_MSG_CHECKING([for fopen64])
103 AC_CACHE_VAL(bu_cv_have_fopen64,
104 [AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
105 bu_cv_have_fopen64=yes,
106 [saved_CPPFLAGS=$CPPFLAGS
107 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
108 AC_TRY_LINK([#include <stdio.h>], [FILE *f = fopen64 ("/tmp/foo","r");],
109 bu_cv_have_fopen64="need -D_LARGEFILE64_SOURCE",
110 bu_cv_have_fopen64=no)
111 CPPFLAGS=$saved_CPPFLAGS])])
112 AC_MSG_RESULT($bu_cv_have_fopen64)
113 if test "$bu_cv_have_fopen64" != no; then
114 AC_DEFINE([HAVE_FOPEN64], 1,
115 [Is fopen64 available?])
117 AC_MSG_CHECKING([for stat64])
118 AC_CACHE_VAL(bu_cv_have_stat64,
119 [AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
120 bu_cv_have_stat64=yes,
121 [saved_CPPFLAGS=$CPPFLAGS
122 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
123 AC_TRY_LINK([#include <sys/stat.h>], [struct stat64 st; stat64 ("/tmp/foo", &st);],
124 bu_cv_have_stat64="need -D_LARGEFILE64_SOURCE",
125 bu_cv_have_stat64=no)
126 CPPFLAGS=$saved_CPPFLAGS])])
127 AC_MSG_RESULT($bu_cv_have_stat64)
128 if test "$bu_cv_have_stat64" != no; then
129 AC_DEFINE([HAVE_STAT64], 1,
130 [Is stat64 available?])
132 if test "$bu_cv_have_fopen64" = "need -D_LARGEFILE64_SOURCE" \
133 || test "$bu_cv_have_stat64" = "need -D_LARGEFILE64_SOURCE"; then
134 AC_DEFINE([_LARGEFILE64_SOURCE], 1,
136 CPPFLAGS="$CPPFLAGS -D_LARGEFILE64_SOURCE"
139 # Some systems have frexp only in -lm, not in -lc.
140 AC_SEARCH_LIBS(frexp, m)
142 AC_MSG_CHECKING(for time_t in time.h)
143 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
144 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
145 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
146 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
147 if test $bu_cv_decl_time_t_time_h = yes; then
148 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
149 [Is the type time_t defined in <time.h>?])
152 AC_MSG_CHECKING(for time_t in sys/types.h)
153 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
154 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
155 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
156 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
157 if test $bu_cv_decl_time_t_types_h = yes; then
158 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
159 [Is the type time_t defined in <sys/types.h>?])
162 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
163 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
164 [AC_TRY_COMPILE([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);],
165 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
166 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
167 if test $bu_cv_decl_getopt_unistd_h = yes; then
168 AC_DEFINE([HAVE_DECL_GETOPT], 1,
169 [Is the prototype for getopt in <unistd.h> in the expected format?])
172 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
174 AC_MSG_CHECKING([for utime.h])
175 AC_CACHE_VAL(bu_cv_header_utime_h,
176 [AC_TRY_COMPILE([#include <sys/types.h>
182 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
183 AC_MSG_RESULT($bu_cv_header_utime_h)
184 if test $bu_cv_header_utime_h = yes; then
185 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
188 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
189 snprintf, vsnprintf])
193 # target-specific stuff:
195 # Canonicalize the secondary target names.
196 if test -n "$enable_targets"; then
197 for targ in `echo $enable_targets | sed 's/,/ /g'`
199 result=`$ac_config_sub $targ 2>/dev/null`
200 if test -n "$result"; then
201 canon_targets="$canon_targets $result"
203 # Allow targets that config.sub doesn't recognize, like "all".
204 canon_targets="$canon_targets $targ"
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"
230 i[3-7]86*-*-netware*)
232 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
233 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
236 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
237 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
240 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
241 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
244 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
245 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
249 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
253 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
254 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
255 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
257 arm-*-pe* | arm-*-wince)
258 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
259 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
260 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
263 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
264 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
265 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
268 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
270 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
272 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
273 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
278 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
279 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
286 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
288 powerpc*-*-pe* | powerpc*-*-cygwin*)
289 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
290 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
291 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
294 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
295 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
296 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
299 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
300 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
301 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
304 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
305 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
306 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
309 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
310 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
316 if test "${with_windres+set}" = set; then
317 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
320 AC_SUBST(NLMCONV_DEFS)
321 AC_SUBST(BUILD_NLMCONV)
322 AC_SUBST(BUILD_SRCONV)
323 AC_SUBST(BUILD_DLLTOOL)
324 AC_SUBST(DLLTOOL_DEFS)
325 AC_SUBST(BUILD_WINDRES)
326 AC_SUBST(BUILD_DLLWRAP)
328 AC_SUBST(OBJDUMP_DEFS)
330 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
333 . $srcdir/../bfd/config.bfd
334 if test "x$targ_underscore" = "xyes"; then
339 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
340 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
343 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
345 # Canonicalize the secondary target names.
346 result=`$ac_config_sub $targ_alias 2>/dev/null`
347 if test -n "$result"; then
353 . ${srcdir}/configure.tgt
356 EMULATION_VECTOR=$targ_emul_vector
360 AC_SUBST(EMULATION_VECTOR)
362 # Required for html and install-html
363 AC_SUBST(datarootdir)
367 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
369 case "x$CONFIG_FILES" in
370 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;