1 dnl Process this file with autoconf to produce a configure script.
9 AM_INIT_AUTOMAKE(binutils, 2.11.1)
13 AC_ARG_ENABLE(targets,
14 [ --enable-targets alternative target configurations],
15 [case "${enableval}" in
16 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
18 no) enable_targets= ;;
19 *) enable_targets=$enableval ;;
21 AC_ARG_ENABLE(commonbfdlib,
22 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
23 [case "${enableval}" in
24 yes) commonbfdlib=true ;;
25 no) commonbfdlib=false ;;
26 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
29 build_warnings="-W -Wall"
30 AC_ARG_ENABLE(build-warnings,
31 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
32 [case "${enableval}" in
34 no) build_warnings="-w";;
35 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
36 build_warnings="${build_warnings} ${t}";;
37 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
38 build_warnings="${t} ${build_warnings}";;
39 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
41 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
42 echo "Setting warning flags = $build_warnings" 6>&1
45 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
46 WARN_CFLAGS="${build_warnings}"
50 AM_CONFIG_HEADER(config.h:config.in)
52 if test -z "$target" ; then
53 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
55 if test -z "$host" ; then
56 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
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)
100 AC_CHECK_FUNCS(sbrk utimes setmode)
102 # Some systems have frexp only in -lm, not in -lc.
103 AC_SEARCH_LIBS(frexp, m)
105 AC_MSG_CHECKING(for time_t in time.h)
106 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
107 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
108 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
109 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
110 if test $bu_cv_decl_time_t_time_h = yes; then
111 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
112 [Is the type time_t defined in <time.h>?])
115 AC_MSG_CHECKING(for time_t in sys/types.h)
116 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
117 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
118 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
119 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
120 if test $bu_cv_decl_time_t_types_h = yes; then
121 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
122 [Is the type time_t defined in <sys/types.h>?])
125 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
127 AC_MSG_CHECKING([for utime.h])
128 AC_CACHE_VAL(bu_cv_header_utime_h,
129 [AC_TRY_COMPILE([#include <sys/types.h>
135 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
136 AC_MSG_RESULT($bu_cv_header_utime_h)
137 if test $bu_cv_header_utime_h = yes; then
138 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
141 BFD_NEED_DECLARATION(fprintf)
142 BFD_NEED_DECLARATION(strstr)
143 BFD_NEED_DECLARATION(sbrk)
144 BFD_NEED_DECLARATION(getenv)
145 BFD_NEED_DECLARATION(environ)
149 # target-specific stuff:
151 # Canonicalize the secondary target names.
152 if test -n "$enable_targets"; then
153 for targ in `echo $enable_targets | sed 's/,/ /g'`
155 result=`$ac_config_sub $targ 2>/dev/null`
156 if test -n "$result"; then
157 canon_targets="$canon_targets $result"
159 # Allow targets that config.sub doesn't recognize, like "all".
160 canon_targets="$canon_targets $targ"
176 for targ in $target $canon_targets
178 if test "x$targ" = "xall"; then
180 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
181 BUILD_SRCONV='$(SRCONV_PROG)'
182 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
186 i[3456]86*-*-netware*)
188 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
189 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
192 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
193 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
196 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
197 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
200 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
201 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
205 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
209 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
210 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
211 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
213 arm-*pe* | arm-*-wince)
214 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
215 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
216 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
219 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
220 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
221 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
223 arm*-* | xscale-* | strongarm-* | d10v-*)
224 OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
227 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
229 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
230 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
231 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
232 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
235 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
236 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
238 powerpc*-*-*pe* | powerpc*-*-cygwin*)
239 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
240 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
241 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
244 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
245 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
246 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
249 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
251 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
254 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
255 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
256 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
259 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
260 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
266 AC_SUBST(NLMCONV_DEFS)
267 AC_SUBST(BUILD_NLMCONV)
268 AC_SUBST(BUILD_SRCONV)
269 AC_SUBST(BUILD_DLLTOOL)
270 AC_SUBST(DLLTOOL_DEFS)
271 AC_SUBST(BUILD_WINDRES)
272 AC_SUBST(BUILD_DLLWRAP)
274 AC_SUBST(OBJDUMP_DEFS)
276 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
279 . $srcdir/../bfd/config.bfd
280 if test "x$targ_underscore" = "xyes"; then
287 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
289 case "x$CONFIG_FILES" in
290 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;