1 dnl Process this file with autoconf to produce a configure script.
10 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
12 AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
16 AC_ARG_ENABLE(targets,
17 [ --enable-targets alternative target configurations],
18 [case "${enableval}" in
19 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
21 no) enable_targets= ;;
22 *) enable_targets=$enableval ;;
24 AC_ARG_ENABLE(commonbfdlib,
25 [ --enable-commonbfdlib build shared BFD/opcodes/libiberty library],
26 [case "${enableval}" in
27 yes) commonbfdlib=true ;;
28 no) commonbfdlib=false ;;
29 *) AC_MSG_ERROR([bad value ${enableval} for BFD commonbfdlib option]) ;;
32 build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
33 AC_ARG_ENABLE(build-warnings,
34 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
35 [case "${enableval}" in
37 no) build_warnings="-w";;
38 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
39 build_warnings="${build_warnings} ${t}";;
40 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
41 build_warnings="${t} ${build_warnings}";;
42 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
44 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
45 echo "Setting warning flags = $build_warnings" 6>&1
48 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
49 WARN_CFLAGS="${build_warnings}"
53 AM_CONFIG_HEADER(config.h:config.in)
55 if test -z "$target" ; then
56 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
58 if test -z "$host" ; then
59 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
72 if test -n "$EXEEXT"; then
73 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
74 [Does the platform use an executable suffix?])
76 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
77 [Suffix used for executables, if any.])
79 # host-specific stuff:
83 . ${srcdir}/../bfd/configure.host
93 DEMANGLER_NAME=c++filt
95 *-*-go32* | *-*-msdos*)
96 DEMANGLER_NAME=cxxfilt
98 AC_SUBST(DEMANGLER_NAME)
100 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
103 AC_CHECK_FUNCS(sbrk utimes setmode)
105 # Some systems have frexp only in -lm, not in -lc.
106 AC_SEARCH_LIBS(frexp, m)
108 AC_MSG_CHECKING(for time_t in time.h)
109 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
110 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
111 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
112 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
113 if test $bu_cv_decl_time_t_time_h = yes; then
114 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
115 [Is the type time_t defined in <time.h>?])
118 AC_MSG_CHECKING(for time_t in sys/types.h)
119 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
120 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
121 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
122 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
123 if test $bu_cv_decl_time_t_types_h = yes; then
124 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
125 [Is the type time_t defined in <sys/types.h>?])
128 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
130 AC_MSG_CHECKING([for utime.h])
131 AC_CACHE_VAL(bu_cv_header_utime_h,
132 [AC_TRY_COMPILE([#include <sys/types.h>
138 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
139 AC_MSG_RESULT($bu_cv_header_utime_h)
140 if test $bu_cv_header_utime_h = yes; then
141 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
144 BFD_NEED_DECLARATION(fprintf)
145 BFD_NEED_DECLARATION(strstr)
146 BFD_NEED_DECLARATION(sbrk)
147 BFD_NEED_DECLARATION(getenv)
148 BFD_NEED_DECLARATION(environ)
152 # target-specific stuff:
154 # Canonicalize the secondary target names.
155 if test -n "$enable_targets"; then
156 for targ in `echo $enable_targets | sed 's/,/ /g'`
158 result=`$ac_config_sub $targ 2>/dev/null`
159 if test -n "$result"; then
160 canon_targets="$canon_targets $result"
162 # Allow targets that config.sub doesn't recognize, like "all".
163 canon_targets="$canon_targets $targ"
179 for targ in $target $canon_targets
181 if test "x$targ" = "xall"; then
183 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
184 BUILD_SRCONV='$(SRCONV_PROG)'
185 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
189 i[3456]86*-*-netware*)
191 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
192 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
195 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
196 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
199 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
200 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
203 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
204 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
208 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
212 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
213 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
214 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
216 arm-*pe* | arm-*-wince)
217 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
218 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
219 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
222 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
223 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
224 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
226 arm*-* | xscale-* | strongarm-* | d10v-*)
227 OBJDUMP_DEFS="-DDISASSEMBLER_NEEDS_RELOCS"
230 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
232 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
233 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
234 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
235 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
238 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
239 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
241 powerpc*-*-*pe* | powerpc*-*-cygwin*)
242 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
243 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
244 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
247 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
248 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
249 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
252 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
253 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
254 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
257 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
258 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
259 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
262 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
263 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
269 if test "${with_windres+set}" = set; then
270 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
273 AC_SUBST(NLMCONV_DEFS)
274 AC_SUBST(BUILD_NLMCONV)
275 AC_SUBST(BUILD_SRCONV)
276 AC_SUBST(BUILD_DLLTOOL)
277 AC_SUBST(DLLTOOL_DEFS)
278 AC_SUBST(BUILD_WINDRES)
279 AC_SUBST(BUILD_DLLWRAP)
281 AC_SUBST(OBJDUMP_DEFS)
283 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
286 . $srcdir/../bfd/config.bfd
287 if test "x$targ_underscore" = "xyes"; then
294 AC_OUTPUT(Makefile doc/Makefile po/Makefile.in:po/Make-in,
296 case "x$CONFIG_FILES" in
297 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;