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.)
47 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
48 [Suffix used for executables, if any.])
50 # host-specific stuff:
54 . ${srcdir}/../bfd/configure.host
64 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
67 AC_CHECK_FUNCS(sbrk utimes)
69 # Some systems have frexp only in -lm, not in -lc.
70 AC_SEARCH_LIBS(frexp, -lm)
72 AC_MSG_CHECKING(for time_t in time.h)
73 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
74 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
75 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
76 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
77 if test $bu_cv_decl_time_t_time_h = yes; then
78 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
79 [Is the type time_t defined 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], 1,
89 [Is the type time_t defined in <sys/types.h>?])
92 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
94 AC_MSG_CHECKING([for utime.h])
95 AC_CACHE_VAL(bu_cv_header_utime_h,
96 [AC_TRY_COMPILE([#include <sys/types.h>
102 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
103 AC_MSG_RESULT($bu_cv_header_utime_h)
104 if test $bu_cv_header_utime_h = yes; then
105 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
108 BFD_NEED_DECLARATION(fprintf)
109 BFD_NEED_DECLARATION(strstr)
110 BFD_NEED_DECLARATION(sbrk)
111 BFD_NEED_DECLARATION(getenv)
112 BFD_NEED_DECLARATION(environ)
116 # target-specific stuff:
118 # Canonicalize the secondary target names.
119 if test -n "$enable_targets"; then
120 for targ in `echo $enable_targets | sed 's/,/ /g'`
122 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
123 if test -n "$result"; then
124 canon_targets="$canon_targets $result"
126 # Allow targets that config.sub doesn't recognize, like "all".
127 canon_targets="$canon_targets $targ"
142 for targ in $target $canon_targets
144 if test "x$targ" = "xall"; then
146 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
147 BUILD_SRCONV='$(SRCONV_PROG)'
148 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
152 i[3456]86*-*-netware*)
154 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
155 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
158 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
159 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
162 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
163 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
166 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
167 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
171 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
175 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
176 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
177 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
180 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
181 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
182 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
185 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
187 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
188 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
189 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
190 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
192 powerpc*-*-*pe* | powerpc*-*-cygwin*)
193 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
194 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
195 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
198 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
199 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
200 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
203 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
204 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
210 AC_SUBST(NLMCONV_DEFS)
211 AC_SUBST(BUILD_NLMCONV)
212 AC_SUBST(BUILD_SRCONV)
213 AC_SUBST(BUILD_DLLTOOL)
214 AC_SUBST(DLLTOOL_DEFS)
215 AC_SUBST(BUILD_WINDRES)
216 AC_SUBST(BUILD_DLLWRAP)
219 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
222 . $srcdir/../bfd/config.bfd
223 if test "x$targ_underscore" = "xyes"; then
230 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
232 case "x$CONFIG_FILES" in
233 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;