1 dnl Process this file with autoconf to produce a configure script.
8 AM_INIT_AUTOMAKE(binutils, 2.10.90)
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 build_warnings="-W -Wall"
29 AC_ARG_ENABLE(build-warnings,
30 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
31 [case "${enableval}" in
33 no) build_warnings="-w";;
34 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
35 build_warnings="${build_warnings} ${t}";;
36 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
37 build_warnings="${t} ${build_warnings}";;
38 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
40 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
41 echo "Setting warning flags = $build_warnings" 6>&1
44 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
45 WARN_CFLAGS="${build_warnings}"
49 AM_CONFIG_HEADER(config.h:config.in)
51 if test -z "$target" ; then
52 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
54 if test -z "$host" ; then
55 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
68 if test -n "$EXEEXT"; then
69 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
70 [Does the platform use an executable suffix?])
72 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
73 [Suffix used for executables, if any.])
75 # host-specific stuff:
79 . ${srcdir}/../bfd/configure.host
89 DEMANGLER_NAME=c++filt
91 *-*-go32* | *-*-msdos*)
92 DEMANGLER_NAME=cxxfilt
94 AC_SUBST(DEMANGLER_NAME)
96 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
99 AC_CHECK_FUNCS(sbrk utimes setmode)
101 # Some systems have frexp only in -lm, not in -lc.
102 AC_SEARCH_LIBS(frexp, m)
104 AC_MSG_CHECKING(for time_t in time.h)
105 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
106 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
107 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
108 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
109 if test $bu_cv_decl_time_t_time_h = yes; then
110 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
111 [Is the type time_t defined in <time.h>?])
114 AC_MSG_CHECKING(for time_t in sys/types.h)
115 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
116 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
117 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
118 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
119 if test $bu_cv_decl_time_t_types_h = yes; then
120 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
121 [Is the type time_t defined in <sys/types.h>?])
124 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
126 AC_MSG_CHECKING([for utime.h])
127 AC_CACHE_VAL(bu_cv_header_utime_h,
128 [AC_TRY_COMPILE([#include <sys/types.h>
134 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
135 AC_MSG_RESULT($bu_cv_header_utime_h)
136 if test $bu_cv_header_utime_h = yes; then
137 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
140 BFD_NEED_DECLARATION(fprintf)
141 BFD_NEED_DECLARATION(strstr)
142 BFD_NEED_DECLARATION(sbrk)
143 BFD_NEED_DECLARATION(getenv)
144 BFD_NEED_DECLARATION(environ)
148 # target-specific stuff:
150 # Canonicalize the secondary target names.
151 if test -n "$enable_targets"; then
152 for targ in `echo $enable_targets | sed 's/,/ /g'`
154 result=`$ac_config_sub $targ 2>/dev/null`
155 if test -n "$result"; then
156 canon_targets="$canon_targets $result"
158 # Allow targets that config.sub doesn't recognize, like "all".
159 canon_targets="$canon_targets $targ"
174 for targ in $target $canon_targets
176 if test "x$targ" = "xall"; then
178 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
179 BUILD_SRCONV='$(SRCONV_PROG)'
180 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
184 i[3456]86*-*-netware*)
186 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
187 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
190 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
191 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
194 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
195 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
198 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
199 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
203 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
206 arm-*pe* | arm-*-wince)
207 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
208 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
209 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
212 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
213 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
214 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
217 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
219 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
220 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
221 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
222 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
225 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
226 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
228 powerpc*-*-*pe* | powerpc*-*-cygwin*)
229 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
230 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
231 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
234 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
235 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
236 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
239 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
240 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
241 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
244 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
245 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
246 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
249 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
256 AC_SUBST(NLMCONV_DEFS)
257 AC_SUBST(BUILD_NLMCONV)
258 AC_SUBST(BUILD_SRCONV)
259 AC_SUBST(BUILD_DLLTOOL)
260 AC_SUBST(DLLTOOL_DEFS)
261 AC_SUBST(BUILD_WINDRES)
262 AC_SUBST(BUILD_DLLWRAP)
265 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
268 . $srcdir/../bfd/config.bfd
269 if test "x$targ_underscore" = "xyes"; then
276 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
278 case "x$CONFIG_FILES" in
279 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;