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