Update to match current gas,bfd and opcodes.
[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
7
8AM_INIT_AUTOMAKE(binutils, 2.9.4)
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
47
48# host-specific stuff:
49
50HDEFINES=
51
52. ${srcdir}/../bfd/configure.host
53
54AC_SUBST(HDEFINES)
55AR=${AR-ar}
56AC_SUBST(AR)
57AC_PROG_RANLIB
58AC_PROG_INSTALL
59
60BFD_CC_FOR_BUILD
61
62AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
63AC_HEADER_SYS_WAIT
64AC_FUNC_ALLOCA
65AC_CHECK_FUNCS(sbrk utimes)
66
67AC_MSG_CHECKING(for time_t in time.h)
68AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
69[AC_TRY_COMPILE([#include <time.h>], [time_t i;],
70bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
71AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
72if test $bu_cv_decl_time_t_time_h = yes; then
73 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
74 [Is the type time_t defined in <time.h>?])
75fi
76
77AC_MSG_CHECKING(for time_t in sys/types.h)
78AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
79[AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
80bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
81AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
82if test $bu_cv_decl_time_t_types_h = yes; then
83 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
84 [Is the type time_t defined in <sys/types.h>?])
85fi
86
87# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
88# by default.
89AC_MSG_CHECKING([for utime.h])
90AC_CACHE_VAL(bu_cv_header_utime_h,
91[AC_TRY_COMPILE([#include <sys/types.h>
92#ifdef HAVE_TIME_H
93#include <time.h>
94#endif
95#include <utime.h>],
96[struct utimbuf s;],
97bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
98AC_MSG_RESULT($bu_cv_header_utime_h)
99if test $bu_cv_header_utime_h = yes; then
100 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
101fi
102
103BFD_NEED_DECLARATION(fprintf)
104BFD_NEED_DECLARATION(strstr)
105BFD_NEED_DECLARATION(sbrk)
106BFD_NEED_DECLARATION(getenv)
107BFD_NEED_DECLARATION(environ)
108
109BFD_BINARY_FOPEN
110
111# target-specific stuff:
112
113# Canonicalize the secondary target names.
114if test -n "$enable_targets"; then
115 for targ in `echo $enable_targets | sed 's/,/ /g'`
116 do
117 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
118 if test -n "$result"; then
119 canon_targets="$canon_targets $result"
120 else
121 # Allow targets that config.sub doesn't recognize, like "all".
122 canon_targets="$canon_targets $targ"
123 fi
124 done
125fi
126
127all_targets=false
128BUILD_NLMCONV=
129NLMCONV_DEFS=
130BUILD_SRCONV=
131BUILD_DLLTOOL=
132DLLTOOL_DEFS=
133BUILD_WINDRES=
134BUILD_DLLWRAP=
135BUILD_MISC=
136
137for targ in $target $canon_targets
138do
139 if test "x$targ" = "xall"; then
140 all_targets=true
141 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
142 BUILD_SRCONV='$(SRCONV_PROG)'
143 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
144 else
145 case $targ in
146changequote(,)dnl
147 i[3456]86*-*-netware*)
148changequote([,])dnl
149 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
150 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
151 ;;
152 alpha*-*-netware*)
153 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
154 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
155 ;;
156 powerpc*-*-netware*)
157 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
159 ;;
160 sparc*-*-netware*)
161 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
162 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
163 ;;
164 esac
165 case $targ in
166 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
167 esac
168 case $targ in
169 arm-*pe*)
170 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
171 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
172 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
173 ;;
174 thumb-*pe*)
175 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
176 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
177 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
178 ;;
179changequote(,)dnl
180 i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
181changequote([,])dnl
182 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
183 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
184 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
185 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
186 ;;
187 powerpc*-*-*pe* | powerpc*-*-cygwin*)
188 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
189 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
190 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
191 ;;
661016bb
NC
192 mcore-*pe)
193 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
194 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
195 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
196 ;;
197 mcore-*elf)
198 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
199 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
200 ;;
252b5132
RH
201 esac
202 fi
203done
204
205AC_SUBST(NLMCONV_DEFS)
206AC_SUBST(BUILD_NLMCONV)
207AC_SUBST(BUILD_SRCONV)
208AC_SUBST(BUILD_DLLTOOL)
209AC_SUBST(DLLTOOL_DEFS)
210AC_SUBST(BUILD_WINDRES)
211AC_SUBST(BUILD_DLLWRAP)
212AC_SUBST(BUILD_MISC)
213
214AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
215
216targ=$target
217. $srcdir/../bfd/config.bfd
218if test "x$targ_underscore" = "xyes"; then
219 UNDERSCORE=1
220else
221 UNDERSCORE=0
222fi
223AC_SUBST(UNDERSCORE)
224
225AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
226[
227case "x$CONFIG_FILES" in
228*) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
229esac
230])
This page took 0.032158 seconds and 4 git commands to generate.