]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - binutils/configure.in
Remove ``-W -Wall'' from top-level Makefile/configure.
[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
a2d91340
AC
28build_warnings="-W -Wall"
29AC_ARG_ENABLE(build-warnings,
30[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
31[case "${enableval}" in
32 yes) ;;
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"`;;
39esac
40if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
41 echo "Setting warning flags = $build_warnings" 6>&1
42fi])dnl
43WARN_CFLAGS=""
44if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
45 WARN_CFLAGS="${build_warnings}"
46fi
47AC_SUBST(WARN_CFLAGS)
48
252b5132
RH
49AM_CONFIG_HEADER(config.h:config.in)
50
51if test -z "$target" ; then
52 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
53fi
54if test -z "$host" ; then
55 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
56fi
57
58AC_PROG_CC
59
60AC_PROG_YACC
61AM_PROG_LEX
62
63ALL_LINGUAS=
64CY_GNU_GETTEXT
65
66AM_MAINTAINER_MODE
67AC_EXEEXT
2481e6a2
ILT
68if test -n "$EXEEXT"; then
69 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
70 [Does the platform use an executable suffix?])
71fi
bb0cb4db
ILT
72AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
73 [Suffix used for executables, if any.])
252b5132
RH
74
75# host-specific stuff:
76
77HDEFINES=
78
79. ${srcdir}/../bfd/configure.host
80
81AC_SUBST(HDEFINES)
82AR=${AR-ar}
83AC_SUBST(AR)
84AC_PROG_RANLIB
85AC_PROG_INSTALL
86
87BFD_CC_FOR_BUILD
88
8a965946
ILT
89DEMANGLER_NAME=c++filt
90case "${host}" in
91 *-*-go32* | *-*-msdos*)
92 DEMANGLER_NAME=cxxfilt
93esac
94AC_SUBST(DEMANGLER_NAME)
95
252b5132
RH
96AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
97AC_HEADER_SYS_WAIT
98AC_FUNC_ALLOCA
99AC_CHECK_FUNCS(sbrk utimes)
100
f353eb8a 101# Some systems have frexp only in -lm, not in -lc.
07735828 102AC_SEARCH_LIBS(frexp, m)
f353eb8a 103
252b5132
RH
104AC_MSG_CHECKING(for time_t in time.h)
105AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
106[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
107bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
108AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
109if 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>?])
112fi
113
114AC_MSG_CHECKING(for time_t in sys/types.h)
115AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
116[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
117bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
118AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
119if 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>?])
122fi
123
124# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
125# by default.
126AC_MSG_CHECKING([for utime.h])
127AC_CACHE_VAL(bu_cv_header_utime_h,
128[AC_TRY_COMPILE([#include <sys/types.h>
129#ifdef HAVE_TIME_H
130#include <time.h>
131#endif
132#include <utime.h>],
133[struct utimbuf s;],
134bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
135AC_MSG_RESULT($bu_cv_header_utime_h)
136if test $bu_cv_header_utime_h = yes; then
137 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
138fi
139
140BFD_NEED_DECLARATION(fprintf)
141BFD_NEED_DECLARATION(strstr)
142BFD_NEED_DECLARATION(sbrk)
143BFD_NEED_DECLARATION(getenv)
144BFD_NEED_DECLARATION(environ)
145
146BFD_BINARY_FOPEN
147
148# target-specific stuff:
149
150# Canonicalize the secondary target names.
151if test -n "$enable_targets"; then
152 for targ in `echo $enable_targets | sed 's/,/ /g'`
153 do
6d83c84b 154 result=`$ac_config_sub $targ 2>/dev/null`
252b5132
RH
155 if test -n "$result"; then
156 canon_targets="$canon_targets $result"
157 else
158 # Allow targets that config.sub doesn't recognize, like "all".
159 canon_targets="$canon_targets $targ"
160 fi
161 done
162fi
163
164all_targets=false
165BUILD_NLMCONV=
166NLMCONV_DEFS=
167BUILD_SRCONV=
168BUILD_DLLTOOL=
169DLLTOOL_DEFS=
170BUILD_WINDRES=
171BUILD_DLLWRAP=
172BUILD_MISC=
173
174for targ in $target $canon_targets
175do
176 if test "x$targ" = "xall"; then
177 all_targets=true
178 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
179 BUILD_SRCONV='$(SRCONV_PROG)'
180 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
181 else
182 case $targ in
183changequote(,)dnl
184 i[3456]86*-*-netware*)
185changequote([,])dnl
186 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
187 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
188 ;;
189 alpha*-*-netware*)
190 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
191 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
192 ;;
193 powerpc*-*-netware*)
194 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
195 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
196 ;;
197 sparc*-*-netware*)
198 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
199 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
200 ;;
201 esac
202 case $targ in
203 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
204 esac
205 case $targ in
8a0e0f38 206 arm-*pe* | arm-*-wince)
252b5132
RH
207 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
208 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
209 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 210 ;;
252b5132
RH
211 thumb-*pe*)
212 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
213 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
214 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 215 ;;
252b5132
RH
216changequote(,)dnl
217 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
218changequote([,])dnl
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)'
7a7b06ef
ILT
223 ;;
224 i[3-6]86-*-interix)
225 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
226 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
227 ;;
252b5132
RH
228 powerpc*-*-*pe* | powerpc*-*-cygwin*)
229 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
230 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
231 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 232 ;;
8a0e0f38
NC
233 sh*-*-*pe)
234 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
235 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
236 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
237 ;;
238 mips*-*-*pe)
239 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
240 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
241 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
242 ;;
661016bb
NC
243 mcore-*pe)
244 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
245 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
246 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
7a7b06ef 247 ;;
661016bb
NC
248 mcore-*elf)
249 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
7a7b06ef 251 ;;
252b5132
RH
252 esac
253 fi
254done
255
256AC_SUBST(NLMCONV_DEFS)
257AC_SUBST(BUILD_NLMCONV)
258AC_SUBST(BUILD_SRCONV)
259AC_SUBST(BUILD_DLLTOOL)
260AC_SUBST(DLLTOOL_DEFS)
261AC_SUBST(BUILD_WINDRES)
262AC_SUBST(BUILD_DLLWRAP)
263AC_SUBST(BUILD_MISC)
264
265AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
266
267targ=$target
268. $srcdir/../bfd/config.bfd
269if test "x$targ_underscore" = "xyes"; then
270 UNDERSCORE=1
271else
272 UNDERSCORE=0
273fi
274AC_SUBST(UNDERSCORE)
275
276AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
277[
278case "x$CONFIG_FILES" in
279*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
280esac
281])