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