1 dnl Process this file with autoconf to produce a configure script.
8 AM_INIT_AUTOMAKE(binutils, 2.8.2)
12 AC_ARG_ENABLE(targets,
13 [ --enable-targets alternative target configurations],
14 [case "${enableval}" in
15 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
17 no) enable_targets= ;;
18 *) enable_targets=$enableval ;;
20 AC_ARG_ENABLE(commonbfdlib,
21 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
22 [case "${enableval}" in
23 yes) commonbfdlib=true ;;
24 no) commonbfdlib=false ;;
25 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
28 AM_CONFIG_HEADER(config.h:config.in)
30 if test -z "$target" ; then
31 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
33 if test -z "$host" ; then
34 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
47 # host-specific stuff:
51 . ${srcdir}/../bfd/configure.host
61 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
64 AC_CHECK_FUNCS(sbrk utimes)
65 dnl Temporary workaround for bug in autoconf 2.12. When the bug is
66 dnl fixed, we can just call AC_FUNC_VFORK in all cases.
67 if test "x$cross_compiling" = "xno"; then
70 AC_CHECK_FUNC(vfork, , AC_DEFINE(vfork, fork))
73 AC_MSG_CHECKING(for time_t in time.h)
74 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
75 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
76 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
77 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
78 if test $bu_cv_decl_time_t_time_h = yes; then
79 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
82 AC_MSG_CHECKING(for time_t in sys/types.h)
83 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
84 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
85 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
86 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
87 if test $bu_cv_decl_time_t_types_h = yes; then
88 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
91 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
93 AC_MSG_CHECKING([for utime.h])
94 AC_CACHE_VAL(bu_cv_header_utime_h,
95 [AC_TRY_COMPILE([#include <sys/types.h>
101 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
102 AC_MSG_RESULT($bu_cv_header_utime_h)
103 if test $bu_cv_header_utime_h = yes; then
104 AC_DEFINE(HAVE_GOOD_UTIME_H)
107 BFD_NEED_DECLARATION(fprintf)
108 BFD_NEED_DECLARATION(strstr)
109 BFD_NEED_DECLARATION(sbrk)
110 BFD_NEED_DECLARATION(getenv)
114 # target-specific stuff:
116 # Canonicalize the secondary target names.
117 if test -n "$enable_targets"; then
118 for targ in `echo $enable_targets | sed 's/,/ /g'`
120 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
121 if test -n "$result"; then
122 canon_targets="$canon_targets $result"
124 # Allow targets that config.sub doesn't recognize, like "all".
125 canon_targets="$canon_targets $targ"
138 for targ in $target $canon_targets
140 if test "x$targ" = "xall"; then
142 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
143 BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
144 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
148 i[3456]86*-*-netware*)
150 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
151 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
154 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
155 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
158 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
159 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
162 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
163 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
167 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
171 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
172 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
173 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
176 i[3-6]86-*pe* | i[3-6]86-*-cygwin32)
178 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
179 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
180 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
182 powerpc*-*-*pe* | powerpc*-*-cygwin32)
183 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
184 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
185 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
191 AC_SUBST(NLMCONV_DEFS)
192 AC_SUBST(BUILD_NLMCONV)
193 AC_SUBST(BUILD_SRCONV)
194 AC_SUBST(BUILD_DLLTOOL)
195 AC_SUBST(DLLTOOL_DEFS)
196 AC_SUBST(BUILD_WINDRES)
199 . $srcdir/../bfd/config.bfd
200 if test "x$targ_underscore" = "xyes"; then