]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/configure.in
Fix problem with going to automake 2.14
[thirdparty/binutils-gdb.git] / binutils / configure.in
CommitLineData
252b5132
RH
1dnl Process this file with autoconf to produce a configure script.
2dnl
3AC_PREREQ(2.13)
4AC_INIT(ar.c)
5
6AC_CANONICAL_SYSTEM
7
2844ed43 8AM_INIT_AUTOMAKE(binutils, 2.9.5)
252b5132
RH
9
10AM_PROG_LIBTOOL
11
12AC_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')
16 ;;
17 no) enable_targets= ;;
18 *) enable_targets=$enableval ;;
19esac])dnl
20AC_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]) ;;
26esac])dnl
27
28AM_CONFIG_HEADER(config.h:config.in)
29
30if test -z "$target" ; then
31 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
32fi
33if test -z "$host" ; then
34 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
35fi
36
37AC_PROG_CC
38
39AC_PROG_YACC
40AM_PROG_LEX
41
42ALL_LINGUAS=
43CY_GNU_GETTEXT
44
45AM_MAINTAINER_MODE
46AC_EXEEXT
2481e6a2
ILT
47if test -n "$EXEEXT"; then
48 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
49 [Does the platform use an executable suffix?])
50fi
bb0cb4db
ILT
51AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
52 [Suffix used for executables, if any.])
252b5132
RH
53
54# host-specific stuff:
55
56HDEFINES=
57
58. ${srcdir}/../bfd/configure.host
59
60AC_SUBST(HDEFINES)
61AR=${AR-ar}
62AC_SUBST(AR)
63AC_PROG_RANLIB
64AC_PROG_INSTALL
65
66BFD_CC_FOR_BUILD
67
8a965946
ILT
68DEMANGLER_NAME=c++filt
69case "${host}" in
70 *-*-go32* | *-*-msdos*)
71 DEMANGLER_NAME=cxxfilt
72esac
73AC_SUBST(DEMANGLER_NAME)
74
252b5132
RH
75AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
76AC_HEADER_SYS_WAIT
77AC_FUNC_ALLOCA
78AC_CHECK_FUNCS(sbrk utimes)
79
f353eb8a
ILT
80# Some systems have frexp only in -lm, not in -lc.
81AC_SEARCH_LIBS(frexp, -lm)
82
252b5132
RH
83AC_MSG_CHECKING(for time_t in time.h)
84AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
85[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
86bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
87AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
88if 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>?])
91fi
92
93AC_MSG_CHECKING(for time_t in sys/types.h)
94AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
95[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
96bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
97AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
98if 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>?])
101fi
102
103# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
104# by default.
105AC_MSG_CHECKING([for utime.h])
106AC_CACHE_VAL(bu_cv_header_utime_h,
107[AC_TRY_COMPILE([#include <sys/types.h>
108#ifdef HAVE_TIME_H
109#include <time.h>
110#endif
111#include <utime.h>],
112[struct utimbuf s;],
113bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
114AC_MSG_RESULT($bu_cv_header_utime_h)
115if test $bu_cv_header_utime_h = yes; then
116 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
117fi
118
119BFD_NEED_DECLARATION(fprintf)
120BFD_NEED_DECLARATION(strstr)
121BFD_NEED_DECLARATION(sbrk)
122BFD_NEED_DECLARATION(getenv)
123BFD_NEED_DECLARATION(environ)
124
125BFD_BINARY_FOPEN
126
127# target-specific stuff:
128
129# Canonicalize the secondary target names.
130if test -n "$enable_targets"; then
131 for targ in `echo $enable_targets | sed 's/,/ /g'`
132 do
133 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
134 if test -n "$result"; then
135 canon_targets="$canon_targets $result"
136 else
137 # Allow targets that config.sub doesn't recognize, like "all".
138 canon_targets="$canon_targets $targ"
139 fi
140 done
141fi
142
143all_targets=false
144BUILD_NLMCONV=
145NLMCONV_DEFS=
146BUILD_SRCONV=
147BUILD_DLLTOOL=
148DLLTOOL_DEFS=
149BUILD_WINDRES=
150BUILD_DLLWRAP=
151BUILD_MISC=
152
153for targ in $target $canon_targets
154do
155 if test "x$targ" = "xall"; then
156 all_targets=true
157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158 BUILD_SRCONV='$(SRCONV_PROG)'
159 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
160 else
161 case $targ in
162changequote(,)dnl
163 i[3456]86*-*-netware*)
164changequote([,])dnl
165 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
166 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
167 ;;
168 alpha*-*-netware*)
169 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
170 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
171 ;;
172 powerpc*-*-netware*)
173 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
174 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
175 ;;
176 sparc*-*-netware*)
177 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
178 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
179 ;;
180 esac
181 case $targ in
182 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
183 esac
184 case $targ in
185 arm-*pe*)
186 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
187 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
188 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 189 ;;
252b5132
RH
190 thumb-*pe*)
191 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
192 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
193 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 194 ;;
252b5132
RH
195changequote(,)dnl
196 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
197changequote([,])dnl
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)'
7a7b06ef
ILT
202 ;;
203 i[3-6]86-*-interix)
204 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
205 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
206 ;;
252b5132
RH
207 powerpc*-*-*pe* | powerpc*-*-cygwin*)
208 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
209 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
210 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 211 ;;
661016bb
NC
212 mcore-*pe)
213 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
214 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
215 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 216 ;;
661016bb
NC
217 mcore-*elf)
218 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
219 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
7a7b06ef 220 ;;
252b5132
RH
221 esac
222 fi
223done
224
225AC_SUBST(NLMCONV_DEFS)
226AC_SUBST(BUILD_NLMCONV)
227AC_SUBST(BUILD_SRCONV)
228AC_SUBST(BUILD_DLLTOOL)
229AC_SUBST(DLLTOOL_DEFS)
230AC_SUBST(BUILD_WINDRES)
231AC_SUBST(BUILD_DLLWRAP)
232AC_SUBST(BUILD_MISC)
233
234AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
235
236targ=$target
237. $srcdir/../bfd/config.bfd
238if test "x$targ_underscore" = "xyes"; then
239 UNDERSCORE=1
240else
241 UNDERSCORE=0
242fi
243AC_SUBST(UNDERSCORE)
244
245AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
246[
247case "x$CONFIG_FILES" in
248*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
249esac
250])