1 dnl Process this file with autoconf to produce a configure script.
8 AM_INIT_AUTOMAKE(binutils, 2.9.5)
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 if test -n "$EXEEXT"; then
48 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
49 [Does the platform use an executable suffix?])
51 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
52 [Suffix used for executables, if any.])
54 # host-specific stuff:
58 . ${srcdir}/../bfd/configure.host
68 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
71 AC_CHECK_FUNCS(sbrk utimes)
73 # Some systems have frexp only in -lm, not in -lc.
74 AC_SEARCH_LIBS(frexp, -lm)
76 AC_MSG_CHECKING(for time_t in time.h)
77 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
78 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
79 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
80 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
81 if test $bu_cv_decl_time_t_time_h = yes; then
82 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
83 [Is the type time_t defined in <time.h>?])
86 AC_MSG_CHECKING(for time_t in sys/types.h)
87 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
88 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
89 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
90 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
91 if test $bu_cv_decl_time_t_types_h = yes; then
92 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
93 [Is the type time_t defined in <sys/types.h>?])
96 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
98 AC_MSG_CHECKING([for utime.h])
99 AC_CACHE_VAL(bu_cv_header_utime_h,
100 [AC_TRY_COMPILE([#include <sys/types.h>
106 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
107 AC_MSG_RESULT($bu_cv_header_utime_h)
108 if test $bu_cv_header_utime_h = yes; then
109 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
112 BFD_NEED_DECLARATION(fprintf)
113 BFD_NEED_DECLARATION(strstr)
114 BFD_NEED_DECLARATION(sbrk)
115 BFD_NEED_DECLARATION(getenv)
116 BFD_NEED_DECLARATION(environ)
120 # target-specific stuff:
122 # Canonicalize the secondary target names.
123 if test -n "$enable_targets"; then
124 for targ in `echo $enable_targets | sed 's/,/ /g'`
126 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
127 if test -n "$result"; then
128 canon_targets="$canon_targets $result"
130 # Allow targets that config.sub doesn't recognize, like "all".
131 canon_targets="$canon_targets $targ"
146 for targ in $target $canon_targets
148 if test "x$targ" = "xall"; then
150 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
151 BUILD_SRCONV='$(SRCONV_PROG)'
152 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
156 i[3456]86*-*-netware*)
158 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
159 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
162 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
163 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
166 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
167 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
170 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
171 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
175 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
179 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
180 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
181 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
184 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
185 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
186 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
189 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
191 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
192 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
193 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
194 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
196 powerpc*-*-*pe* | powerpc*-*-cygwin*)
197 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
198 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
199 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
202 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
203 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
204 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
207 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
208 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
214 AC_SUBST(NLMCONV_DEFS)
215 AC_SUBST(BUILD_NLMCONV)
216 AC_SUBST(BUILD_SRCONV)
217 AC_SUBST(BUILD_DLLTOOL)
218 AC_SUBST(DLLTOOL_DEFS)
219 AC_SUBST(BUILD_WINDRES)
220 AC_SUBST(BUILD_DLLWRAP)
223 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
226 . $srcdir/../bfd/config.bfd
227 if test "x$targ_underscore" = "xyes"; then
234 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
236 case "x$CONFIG_FILES" in
237 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;