2000-02-27 Thomas de Lellis <tdel@windriver.com>
[binutils.git] / binutils / configure.in
blobaa10ce90e2c6296779e35d8f59e34cb0c460a795
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.13)
4 AC_INIT(ar.c)
6 AC_CANONICAL_SYSTEM
8 AM_INIT_AUTOMAKE(binutils, 2.9.5)
10 AM_PROG_LIBTOOL
12 AC_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 ;;
19 esac])dnl
20 AC_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]) ;;
26 esac])dnl
28 AM_CONFIG_HEADER(config.h:config.in)
30 if test -z "$target" ; then
31     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
33 if test -z "$host" ; then
34     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
37 AC_PROG_CC
39 AC_PROG_YACC
40 AM_PROG_LEX
42 ALL_LINGUAS=
43 CY_GNU_GETTEXT
45 AM_MAINTAINER_MODE
46 AC_EXEEXT
47 if test -n "$EXEEXT"; then
48   AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
49             [Does the platform use an executable suffix?])
51 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
52                    [Suffix used for executables, if any.])
54 # host-specific stuff:
56 HDEFINES=
58 . ${srcdir}/../bfd/configure.host
60 AC_SUBST(HDEFINES)
61 AR=${AR-ar}
62 AC_SUBST(AR)
63 AC_PROG_RANLIB
64 AC_PROG_INSTALL
66 BFD_CC_FOR_BUILD
68 DEMANGLER_NAME=c++filt
69 case "${host}" in
70   *-*-go32* | *-*-msdos*)
71     DEMANGLER_NAME=cxxfilt
72 esac
73 AC_SUBST(DEMANGLER_NAME)
75 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
76 AC_HEADER_SYS_WAIT
77 AC_FUNC_ALLOCA
78 AC_CHECK_FUNCS(sbrk utimes)
80 # Some systems have frexp only in -lm, not in -lc.
81 AC_SEARCH_LIBS(frexp, m)
83 AC_MSG_CHECKING(for time_t in time.h)
84 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
85 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
86 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
87 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
88 if test $bu_cv_decl_time_t_time_h = yes; then
89   AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
90             [Is the type time_t defined in <time.h>?])
93 AC_MSG_CHECKING(for time_t in sys/types.h)
94 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
95 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
96 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
97 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
98 if test $bu_cv_decl_time_t_types_h = yes; then
99   AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
100             [Is the type time_t defined in <sys/types.h>?])
103 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
104 # by default.
105 AC_MSG_CHECKING([for utime.h])
106 AC_CACHE_VAL(bu_cv_header_utime_h,
107 [AC_TRY_COMPILE([#include <sys/types.h>
108 #ifdef HAVE_TIME_H
109 #include <time.h>
110 #endif
111 #include <utime.h>],
112 [struct utimbuf s;],
113 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
114 AC_MSG_RESULT($bu_cv_header_utime_h)
115 if test $bu_cv_header_utime_h = yes; then
116   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
119 BFD_NEED_DECLARATION(fprintf)
120 BFD_NEED_DECLARATION(strstr)
121 BFD_NEED_DECLARATION(sbrk)
122 BFD_NEED_DECLARATION(getenv)
123 BFD_NEED_DECLARATION(environ)
125 BFD_BINARY_FOPEN
127 # target-specific stuff:
129 # Canonicalize the secondary target names.
130 if test -n "$enable_targets"; then
131     for targ in `echo $enable_targets | sed 's/,/ /g'`
132     do
133         result=`$ac_config_sub $targ 2>/dev/null`
134         if test -n "$result"; then
135             canon_targets="$canon_targets $result"
136         else
137             # Allow targets that config.sub doesn't recognize, like "all".
138             canon_targets="$canon_targets $targ"
139         fi
140     done
143 all_targets=false
144 BUILD_NLMCONV=
145 NLMCONV_DEFS=
146 BUILD_SRCONV=
147 BUILD_DLLTOOL=
148 DLLTOOL_DEFS=
149 BUILD_WINDRES=
150 BUILD_DLLWRAP=
151 BUILD_MISC=
153 for targ in $target $canon_targets
155     if test "x$targ" = "xall"; then
156         all_targets=true
157         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
158         BUILD_SRCONV='$(SRCONV_PROG)'
159         NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
160     else
161         case $targ in
162 changequote(,)dnl
163         i[3456]86*-*-netware*) 
164 changequote([,])dnl
165           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
166           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
167           ;;
168         alpha*-*-netware*)
169           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
170           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
171           ;;
172         powerpc*-*-netware*)
173           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
174           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
175           ;;
176         sparc*-*-netware*)
177           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
178           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
179           ;;
180         esac
181         case $targ in
182         *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
183         esac
184         case $targ in
185         arm-*pe* | arm-*-wince)
186           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
187           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
188           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
189           ;;
190         thumb-*pe*)
191           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
192           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
193           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
194           ;;
195 changequote(,)dnl
196         i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
197 changequote([,])dnl
198           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
199           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
200           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
201           BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
202           ;;
203         i[3-6]86-*-interix)
204           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
205           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
206           ;;
207         powerpc*-*-*pe* | powerpc*-*-cygwin*)
208           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
209           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
210           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
211           ;;
212         sh*-*-*pe)
213           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
214           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
215           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
216           ;;
217         mips*-*-*pe)
218           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
219           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
220           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
221           ;;
222         mcore-*pe)
223           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
224           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
225           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
226           ;;
227         mcore-*elf)
228           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
229           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
230           ;;
231         esac
232     fi
233 done
235 AC_SUBST(NLMCONV_DEFS)
236 AC_SUBST(BUILD_NLMCONV)
237 AC_SUBST(BUILD_SRCONV)
238 AC_SUBST(BUILD_DLLTOOL)
239 AC_SUBST(DLLTOOL_DEFS)
240 AC_SUBST(BUILD_WINDRES)
241 AC_SUBST(BUILD_DLLWRAP)
242 AC_SUBST(BUILD_MISC)
244 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
246 targ=$target
247 . $srcdir/../bfd/config.bfd
248 if test "x$targ_underscore" = "xyes"; then
249     UNDERSCORE=1
250 else
251     UNDERSCORE=0
253 AC_SUBST(UNDERSCORE)
255 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
257 case "x$CONFIG_FILES" in
258 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
259 esac