1 dnl Process this file with autoconf to produce a configure script.
8 AM_INIT_AUTOMAKE(binutils, 2.9.4)
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.)
48 # host-specific stuff:
52 . ${srcdir}/../bfd/configure.host
62 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
65 AC_CHECK_FUNCS(sbrk utimes)
67 AC_MSG_CHECKING(for time_t in time.h)
68 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
69 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
70 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
71 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
72 if test $bu_cv_decl_time_t_time_h = yes; then
73 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
74 [Is the type time_t defined in <time.h>?])
77 AC_MSG_CHECKING(for time_t in sys/types.h)
78 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
79 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
80 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
81 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
82 if test $bu_cv_decl_time_t_types_h = yes; then
83 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
84 [Is the type time_t defined in <sys/types.h>?])
87 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
89 AC_MSG_CHECKING([for utime.h])
90 AC_CACHE_VAL(bu_cv_header_utime_h,
91 [AC_TRY_COMPILE([#include <sys/types.h>
97 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
98 AC_MSG_RESULT($bu_cv_header_utime_h)
99 if test $bu_cv_header_utime_h = yes; then
100 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
103 BFD_NEED_DECLARATION(fprintf)
104 BFD_NEED_DECLARATION(strstr)
105 BFD_NEED_DECLARATION(sbrk)
106 BFD_NEED_DECLARATION(getenv)
107 BFD_NEED_DECLARATION(environ)
111 # target-specific stuff:
113 # Canonicalize the secondary target names.
114 if test -n "$enable_targets"; then
115 for targ in `echo $enable_targets | sed 's/,/ /g'`
117 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
118 if test -n "$result"; then
119 canon_targets="$canon_targets $result"
121 # Allow targets that config.sub doesn't recognize, like "all".
122 canon_targets="$canon_targets $targ"
137 for targ in $target $canon_targets
139 if test "x$targ" = "xall"; then
141 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
142 BUILD_SRCONV='$(SRCONV_PROG)'
143 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
147 i[3456]86*-*-netware*)
149 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
153 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
161 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
162 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
166 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
170 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
171 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
172 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
175 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
176 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
177 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
180 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
182 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
183 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
184 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
185 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
187 powerpc*-*-*pe* | powerpc*-*-cygwin*)
188 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
189 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
190 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
193 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
194 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
195 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
198 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
199 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
205 AC_SUBST(NLMCONV_DEFS)
206 AC_SUBST(BUILD_NLMCONV)
207 AC_SUBST(BUILD_SRCONV)
208 AC_SUBST(BUILD_DLLTOOL)
209 AC_SUBST(DLLTOOL_DEFS)
210 AC_SUBST(BUILD_WINDRES)
211 AC_SUBST(BUILD_DLLWRAP)
214 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
217 . $srcdir/../bfd/config.bfd
218 if test "x$targ_underscore" = "xyes"; then
225 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
227 case "x$CONFIG_FILES" in
228 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;