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.)
49 # host-specific stuff:
53 . ${srcdir}/../bfd/configure.host
63 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
66 AC_CHECK_FUNCS(sbrk utimes)
68 AC_MSG_CHECKING(for time_t in time.h)
69 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
70 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
71 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
72 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
73 if test $bu_cv_decl_time_t_time_h = yes; then
74 AC_DEFINE([HAVE_TIME_T_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])
86 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
88 AC_MSG_CHECKING([for utime.h])
89 AC_CACHE_VAL(bu_cv_header_utime_h,
90 [AC_TRY_COMPILE([#include <sys/types.h>
96 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
97 AC_MSG_RESULT($bu_cv_header_utime_h)
98 if test $bu_cv_header_utime_h = yes; then
99 AC_DEFINE(HAVE_GOOD_UTIME_H)
102 BFD_NEED_DECLARATION(fprintf)
103 BFD_NEED_DECLARATION(strstr)
104 BFD_NEED_DECLARATION(sbrk)
105 BFD_NEED_DECLARATION(getenv)
109 # target-specific stuff:
111 # Canonicalize the secondary target names.
112 if test -n "$enable_targets"; then
113 for targ in `echo $enable_targets | sed 's/,/ /g'`
115 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
116 if test -n "$result"; then
117 canon_targets="$canon_targets $result"
119 # Allow targets that config.sub doesn't recognize, like "all".
120 canon_targets="$canon_targets $targ"
133 for targ in $target $canon_targets
135 if test "x$targ" = "xall"; then
137 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
138 BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)'
139 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
143 i[3456]86*-*-netware*)
145 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
146 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
149 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
153 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
162 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)$(EXEEXT)' ;;
166 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
167 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
168 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
171 i[3-6]86-*pe* | i[3-6]86-*-cygwin32* | i[3-6]86-*-mingw32*)
173 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
174 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
175 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
177 powerpc*-*-*pe* | powerpc*-*-cygwin32)
178 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
179 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
180 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
186 AC_SUBST(NLMCONV_DEFS)
187 AC_SUBST(BUILD_NLMCONV)
188 AC_SUBST(BUILD_SRCONV)
189 AC_SUBST(BUILD_DLLTOOL)
190 AC_SUBST(DLLTOOL_DEFS)
191 AC_SUBST(BUILD_WINDRES)
193 AC_DEFINE_UNQUOTED(TARGET, "${target}")
196 . $srcdir/../bfd/config.bfd
197 if test "x$targ_underscore" = "xyes"; then
204 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
205 [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])