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