* configure.in: Disable language-specific target libraries for
[binutils.git] / binutils / configure.in
blobd0bd44bb5c8bfe32e1e798de32962da2afa3cbcd
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
7 AC_ISC_POSIX
9 AM_INIT_AUTOMAKE(binutils, 2.10.91)
11 AM_PROG_LIBTOOL
13 AC_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 ;;
20 esac])dnl
21 AC_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]) ;;
27 esac])dnl
29 build_warnings="-W -Wall"
30 AC_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"`;;
40 esac
41 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
42   echo "Setting warning flags = $build_warnings" 6>&1
43 fi])dnl
44 WARN_CFLAGS=""
45 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
46     WARN_CFLAGS="${build_warnings}"
48 AC_SUBST(WARN_CFLAGS)
50 AM_CONFIG_HEADER(config.h:config.in)
52 if test -z "$target" ; then
53     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
55 if test -z "$host" ; then
56     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
59 AC_PROG_CC
61 AC_PROG_YACC
62 AM_PROG_LEX
64 ALL_LINGUAS=
65 CY_GNU_GETTEXT
67 AM_MAINTAINER_MODE
68 AC_EXEEXT
69 if test -n "$EXEEXT"; then
70   AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
71             [Does the platform use an executable suffix?])
73 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
74                    [Suffix used for executables, if any.])
76 # host-specific stuff:
78 HDEFINES=
80 . ${srcdir}/../bfd/configure.host
82 AC_SUBST(HDEFINES)
83 AR=${AR-ar}
84 AC_SUBST(AR)
85 AC_PROG_RANLIB
86 AC_PROG_INSTALL
88 BFD_CC_FOR_BUILD
90 DEMANGLER_NAME=c++filt
91 case "${host}" in
92   *-*-go32* | *-*-msdos*)
93     DEMANGLER_NAME=cxxfilt
94 esac
95 AC_SUBST(DEMANGLER_NAME)
97 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h)
98 AC_HEADER_SYS_WAIT
99 AC_FUNC_ALLOCA
100 AC_CHECK_FUNCS(sbrk utimes setmode)
102 # Some systems have frexp only in -lm, not in -lc.
103 AC_SEARCH_LIBS(frexp, m)
105 AC_MSG_CHECKING(for time_t in time.h)
106 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
107 [AC_TRY_COMPILE([#include <time.h>], [time_t i;],
108 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
109 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
110 if 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>?])
115 AC_MSG_CHECKING(for time_t in sys/types.h)
116 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
117 [AC_TRY_COMPILE([#include <sys/types.h>], [time_t i;],
118 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
119 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
120 if 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>?])
125 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
126 # by default.
127 AC_MSG_CHECKING([for utime.h])
128 AC_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;],
135 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
136 AC_MSG_RESULT($bu_cv_header_utime_h)
137 if test $bu_cv_header_utime_h = yes; then
138   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
141 BFD_NEED_DECLARATION(fprintf)
142 BFD_NEED_DECLARATION(strstr)
143 BFD_NEED_DECLARATION(sbrk)
144 BFD_NEED_DECLARATION(getenv)
145 BFD_NEED_DECLARATION(environ)
147 BFD_BINARY_FOPEN
149 # target-specific stuff:
151 # Canonicalize the secondary target names.
152 if test -n "$enable_targets"; then
153     for targ in `echo $enable_targets | sed 's/,/ /g'`
154     do
155         result=`$ac_config_sub $targ 2>/dev/null`
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
165 all_targets=false
166 BUILD_NLMCONV=
167 NLMCONV_DEFS=
168 BUILD_SRCONV=
169 BUILD_DLLTOOL=
170 DLLTOOL_DEFS=
171 BUILD_WINDRES=
172 BUILD_DLLWRAP=
173 BUILD_MISC=
175 for targ in $target $canon_targets
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
184 changequote(,)dnl
185         i[3456]86*-*-netware*) 
186 changequote([,])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
207         arm-*pe* | arm-*-wince)
208           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
209           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
210           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
211           ;;
212         thumb-*pe*)
213           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
214           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
215           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
216           ;;
217 changequote(,)dnl
218         i[3-6]86-*pe* | i[3-6]86-*-cygwin* | i[3-6]86-*-mingw32*)
219 changequote([,])dnl
220           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
221           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
222           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
223           BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
224           ;;
225         i[3-6]86-*-interix)
226           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
227           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
228           ;;
229         powerpc*-*-*pe* | powerpc*-*-cygwin*)
230           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
231           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
232           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
233           ;;
234         sh*-*-*pe)
235           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
236           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
237           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
238           ;;
239         mips*-*-*pe)
240           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
241           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
242           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
243           ;;
244         mcore-*pe)
245           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
246           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
247           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
248           ;;
249         mcore-*elf)
250           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
251           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
252           ;;
253         esac
254     fi
255 done
257 AC_SUBST(NLMCONV_DEFS)
258 AC_SUBST(BUILD_NLMCONV)
259 AC_SUBST(BUILD_SRCONV)
260 AC_SUBST(BUILD_DLLTOOL)
261 AC_SUBST(DLLTOOL_DEFS)
262 AC_SUBST(BUILD_WINDRES)
263 AC_SUBST(BUILD_DLLWRAP)
264 AC_SUBST(BUILD_MISC)
266 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
268 targ=$target
269 . $srcdir/../bfd/config.bfd
270 if test "x$targ_underscore" = "xyes"; then
271     UNDERSCORE=1
272 else
273     UNDERSCORE=0
275 AC_SUBST(UNDERSCORE)
277 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
279 case "x$CONFIG_FILES" in
280 *) sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile ;;
281 esac