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 DEMANGLER_NAME=c++filt
70 *-*-go32* | *-*-msdos*)
71 DEMANGLER_NAME=cxxfilt
73 AC_SUBST(DEMANGLER_NAME)
75 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
78 AC_CHECK_FUNCS(sbrk utimes)
80 # Some systems have frexp only in -lm, not in -lc.
81 AC_SEARCH_LIBS(frexp, m)
83 AC_MSG_CHECKING(for time_t in time.h)
84 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
85 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
86 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
87 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
88 if test $bu_cv_decl_time_t_time_h = yes; then
89 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
90 [Is the type time_t defined in <time.h>?])
93 AC_MSG_CHECKING(for time_t in sys/types.h)
94 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
95 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
96 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
97 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
98 if test $bu_cv_decl_time_t_types_h = yes; then
99 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
100 [Is the type time_t defined in <sys/types.h>?])
103 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
105 AC_MSG_CHECKING([for utime.h])
106 AC_CACHE_VAL(bu_cv_header_utime_h,
107 [AC_TRY_COMPILE([#include <sys/types.h>
113 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
114 AC_MSG_RESULT($bu_cv_header_utime_h)
115 if test $bu_cv_header_utime_h = yes; then
116 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
119 BFD_NEED_DECLARATION(fprintf)
120 BFD_NEED_DECLARATION(strstr)
121 BFD_NEED_DECLARATION(sbrk)
122 BFD_NEED_DECLARATION(getenv)
123 BFD_NEED_DECLARATION(environ)
127 # target-specific stuff:
129 # Canonicalize the secondary target names.
130 if test -n "$enable_targets"; then
131 for targ in `echo $enable_targets | sed 's/,/ /g'`
133 result=`$ac_config_sub $targ 2>/dev/null`
134 if test -n "$result"; then
135 canon_targets="$canon_targets $result"
137 # Allow targets that config.sub doesn't recognize, like "all".
138 canon_targets="$canon_targets $targ"
153 for targ in $target $canon_targets
155 if test "x$targ" = "xall"; then
157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158 BUILD_SRCONV='$(SRCONV_PROG)'
159 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
163 i[3456]86*-*-netware*)
165 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
166 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
169 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
170 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
173 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
174 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
177 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
178 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
182 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
185 arm-*pe* | arm-*-wince)
186 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
187 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
188 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
191 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
192 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
193 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
196 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
198 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
199 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
200 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
201 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
204 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
205 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
207 powerpc*-*-*pe* | powerpc*-*-cygwin*)
208 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
209 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
210 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
213 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
214 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
215 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
218 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
219 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
220 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
223 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
224 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
225 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
228 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
229 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
235 AC_SUBST(NLMCONV_DEFS)
236 AC_SUBST(BUILD_NLMCONV)
237 AC_SUBST(BUILD_SRCONV)
238 AC_SUBST(BUILD_DLLTOOL)
239 AC_SUBST(DLLTOOL_DEFS)
240 AC_SUBST(BUILD_WINDRES)
241 AC_SUBST(BUILD_DLLWRAP)
244 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
247 . $srcdir/../bfd/config.bfd
248 if test "x$targ_underscore" = "xyes"; then
255 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
257 case "x$CONFIG_FILES" in
258 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;