1 dnl Process this file with autoconf to produce a configure script.
8 AM_INIT_AUTOMAKE(binutils, 2.9.1)
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)
66 AC_MSG_CHECKING(for time_t in time.h)
67 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
68 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
69 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
70 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
71 if test $bu_cv_decl_time_t_time_h = yes; then
72 AC_DEFINE([HAVE_TIME_T_IN_TIME_H])
75 AC_MSG_CHECKING(for time_t in sys/types.h)
76 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
77 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
78 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
79 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
80 if test $bu_cv_decl_time_t_types_h = yes; then
81 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H])
84 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
86 AC_MSG_CHECKING([for utime.h])
87 AC_CACHE_VAL(bu_cv_header_utime_h,
88 [AC_TRY_COMPILE([#include <sys/types.h>
94 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
95 AC_MSG_RESULT($bu_cv_header_utime_h)
96 if test $bu_cv_header_utime_h = yes; then
97 AC_DEFINE(HAVE_GOOD_UTIME_H)
100 BFD_NEED_DECLARATION(fprintf)
101 BFD_NEED_DECLARATION(strstr)
102 BFD_NEED_DECLARATION(sbrk)
103 BFD_NEED_DECLARATION(getenv)
107 # target-specific stuff:
109 # Canonicalize the secondary target names.
110 if test -n "$enable_targets"; then
111 for targ in `echo $enable_targets | sed 's/,/ /g'`
113 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
114 if test -n "$result"; then
115 canon_targets="$canon_targets $result"
117 # Allow targets that config.sub doesn't recognize, like "all".
118 canon_targets="$canon_targets $targ"
131 for targ in $target $canon_targets
133 if test "x$targ" = "xall"; then
135 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
136 BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
137 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
141 i[3456]86*-*-netware*)
143 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
144 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
147 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
148 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
151 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
152 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
155 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
156 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
160 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
164 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
165 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
166 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
169 i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
171 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
172 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
173 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
175 powerpc*-*-*pe* | powerpc*-*-cygwin32)
176 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
177 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
178 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
184 AC_SUBST(NLMCONV_DEFS)
185 AC_SUBST(BUILD_NLMCONV)
186 AC_SUBST(BUILD_SRCONV)
187 AC_SUBST(BUILD_DLLTOOL)
188 AC_SUBST(DLLTOOL_DEFS)
189 AC_SUBST(BUILD_WINDRES)
191 AC_DEFINE_UNQUOTED(TARGET, "${target}")
194 . $srcdir/../bfd/config.bfd
195 if test "x$targ_underscore" = "xyes"; then