daily update
[binutils.git] / binutils / configure.in
blob965d66c168c0054bb1d82745c785c0c3d48905e6
1 dnl Process this file with autoconf to produce a configure script.
2 dnl
3 AC_PREREQ(2.59)
4 AC_INIT
5 AC_CONFIG_SRCDIR(ar.c)
7 AC_CANONICAL_TARGET
8 AC_ISC_POSIX
10 changequote(,)dnl
11 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[         ]*\([^  ]*\)[   ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
12 changequote([,])dnl
13 AM_INIT_AUTOMAKE(binutils, ${BFD_VERSION})
15 AC_PROG_CC
16 AC_GNU_SOURCE
17 AC_USE_SYSTEM_EXTENSIONS
19 ACX_LARGEFILE
20 LT_INIT
22 AC_ARG_ENABLE(targets,
23 [  --enable-targets        alternative target configurations],
24 [case "${enableval}" in
25   yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
26             ;;
27   no)       enable_targets= ;;
28   *)        enable_targets=$enableval ;;
29 esac])dnl
31 AM_BINUTILS_WARNINGS
32                    
33 AC_CONFIG_HEADERS(config.h:config.in)
35 if test -z "$target" ; then
36     AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
38 if test -z "$host" ; then
39     AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
42 AC_PROG_YACC
43 AM_PROG_LEX
45 ALL_LINGUAS="da es fi fr id ja ro ru rw sk sv tr uk vi zh_CN zh_TW bg"
46 ZW_GNU_GETTEXT_SISTER_DIR
47 AM_PO_SUBDIRS
49 AM_MAINTAINER_MODE
50 AM_CONDITIONAL(GENINSRC_NEVER, false)
51 AC_EXEEXT
52 if test -n "$EXEEXT"; then
53   AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
54             [Does the platform use an executable suffix?])
56 AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
57                    [Suffix used for executables, if any.])
59 # host-specific stuff:
61 HDEFINES=
63 . ${srcdir}/../bfd/configure.host
65 AC_SUBST(HDEFINES)
66 AR=${AR-ar}
67 AC_SUBST(AR)
68 AC_PROG_RANLIB
69 AC_PROG_INSTALL
71 BFD_CC_FOR_BUILD
73 DEMANGLER_NAME=c++filt
74 case "${host}" in
75   *-*-go32* | *-*-msdos*)
76     DEMANGLER_NAME=cxxfilt
77 esac
78 AC_SUBST(DEMANGLER_NAME)
80 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h sys/param.h)
81 AC_HEADER_SYS_WAIT
82 AC_FUNC_ALLOCA
83 AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll)
84 AC_CHECK_FUNC([mkstemp],
85               AC_DEFINE([HAVE_MKSTEMP], 1,
86               [Define to 1 if you have the `mkstemp' function.]))
87 AC_CHECK_FUNC([mkdtemp],
88               AC_DEFINE([HAVE_MKDTEMP], 1,
89               [Define to 1 if you have the `mkdtemp' function.]))
91 # Some systems have frexp only in -lm, not in -lc.
92 AC_SEARCH_LIBS(frexp, m)
94 AC_MSG_CHECKING(for time_t in time.h)
95 AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
96 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
97 bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
98 AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
99 if test $bu_cv_decl_time_t_time_h = yes; then
100   AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
101             [Is the type time_t defined in <time.h>?])
104 AC_MSG_CHECKING(for time_t in sys/types.h)
105 AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
106 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
107 bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
108 AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
109 if test $bu_cv_decl_time_t_types_h = yes; then
110   AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
111             [Is the type time_t defined in <sys/types.h>?])
114 AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
115 AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
116 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
117 bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
118 AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
119 if test $bu_cv_decl_getopt_unistd_h = yes; then
120   AC_DEFINE([HAVE_DECL_GETOPT], 1,
121             [Is the prototype for getopt in <unistd.h> in the expected format?])
124 # Under Next 3.2 <utime.h> apparently does not define struct utimbuf
125 # by default.
126 AC_MSG_CHECKING([for utime.h])
127 AC_CACHE_VAL(bu_cv_header_utime_h,
128 [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
129 #ifdef HAVE_TIME_H
130 #include <time.h>
131 #endif
132 #include <utime.h>],
133 [struct utimbuf s;])],
134 bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
135 AC_MSG_RESULT($bu_cv_header_utime_h)
136 if test $bu_cv_header_utime_h = yes; then
137   AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
140 AC_CHECK_DECLS([fprintf, stpcpy, strstr, sbrk, getenv, environ, getc_unlocked,
141                 snprintf, vsnprintf])
143 # Link in zlib if we can.  This allows us to read compressed debug
144 # sections.  This is used only by readelf.c (objdump uses bfd for
145 # reading compressed sections).
146 AC_SEARCH_LIBS(zlibVersion, z, [AC_CHECK_HEADERS(zlib.h)])
148 BFD_BINARY_FOPEN
150 # target-specific stuff:
152 # Canonicalize the secondary target names.
153 if test -n "$enable_targets"; then
154     for targ in `echo $enable_targets | sed 's/,/ /g'`
155     do
156         result=`$ac_config_sub $targ 2>/dev/null`
157         if test -n "$result"; then
158             canon_targets="$canon_targets $result"
159         else
160             # Allow targets that config.sub doesn't recognize, like "all".
161             canon_targets="$canon_targets $targ"
162         fi
163     done
166 AC_CHECK_HEADER(iconv.h)
167 AM_ICONV
169 all_targets=false
170 BUILD_NLMCONV=
171 NLMCONV_DEFS=
172 BUILD_SRCONV=
173 BUILD_DLLTOOL=
174 DLLTOOL_DEFS=
175 DLLTOOL_DEFAULT=
176 BUILD_WINDRES=
177 BUILD_WINDMC=
178 BUILD_DLLWRAP=
179 BUILD_MISC=
180 BUILD_INSTALL_MISC=
181 OBJDUMP_DEFS=
182 OBJDUMP_PRIVATE_VECTORS=
183 OBJDUMP_PRIVATE_OFILES=
184 od_vectors=
186 for targ in $target $canon_targets
188     if test "x$targ" = "xall"; then
189         all_targets=true
190         BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
191         BUILD_SRCONV='$(SRCONV_PROG)'
192         NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
193         BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
194         BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
195         BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
196         BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
197         if test -z "$DLLTOOL_DEFAULT"; then
198           DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
199         fi
200         DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
201         BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
202         od_vectors="$od_vectors objdump_private_desc_xcoff"
203     else
204         case $targ in
205 changequote(,)dnl
206         i[3-7]86*-*-netware*) 
207 changequote([,])dnl
208           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
209           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
210           ;;
211         alpha*-*-netware*)
212           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
213           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
214           ;;
215         powerpc*-*-netware*)
216           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
217           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
218           ;;
219         sparc*-*-netware*)
220           BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
221           NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
222           ;;
223         esac
225         case $targ in
226         *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
227         esac
229         case $targ in
230         arm-epoc-pe*)
231           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
232           if test -z "$DLLTOOL_DEFAULT"; then
233             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
234           fi
235           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
236           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
237           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
238           ;;
239         arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
240           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
241           if test -z "$DLLTOOL_DEFAULT"; then
242             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
243           fi
244           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
245           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
246           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
247           ;;
248         arm-*-pe*)
249           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
250           if test -z "$DLLTOOL_DEFAULT"; then
251             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
252           fi
253           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
254           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
255           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
256           ;;
257         x86_64-*-mingw*)
258           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
259           if test -z "$DLLTOOL_DEFAULT"; then
260             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
261           fi
262           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
263           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
264           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
265           BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
266           ;;
267 changequote(,)dnl
268         i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
269 changequote([,])dnl
270           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
271           if test -z "$DLLTOOL_DEFAULT"; then
272             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
273           fi
274           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
275           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
276           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
277           BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
278           ;;
279 changequote(,)dnl
280         i[3-7]86-*-interix)
281 changequote([,])dnl
282           BUILD_DLLTOOL='$(DLLTOOL_PROG)'
283           if test -z "$DLLTOOL_DEFAULT"; then
284             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
285           fi
286           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
287           ;;
288 changequote(,)dnl
289         powerpc*-aix5.[01])
290 changequote([,])dnl
291           ;;
292 changequote(,)dnl
293         powerpc*-aix[5-9].*)
294 changequote([,])dnl
295           OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
296           ;;
297         powerpc*-*-pe* | powerpc*-*-cygwin*)
298           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
299           if test -z "$DLLTOOL_DEFAULT"; then
300             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
301           fi
302           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
303           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
304           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
305           ;;
306         powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
307           case "$BUILD_INSTALL_MISC" in
308             *embedspu*) ;;
309             *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
310           esac
311           ;;
312         sh*-*-pe)
313           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
314           if test -z "$DLLTOOL_DEFAULT"; then
315             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
316           fi
317           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
318           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
319           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
320           ;;
321         spu-*-*)
322           BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
323           ;;
324         mips*-*-pe)
325           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
326           if test -z "$DLLTOOL_DEFAULT"; then
327             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
328           fi
329           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
330           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
331           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
332           ;;
333         mcore-*-pe)
334           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
335           if test -z "$DLLTOOL_DEFAULT"; then
336             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
337           fi
338           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
339           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
340           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
341           ;;
342         mcore-*-elf)
343           BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
344           if test -z "$DLLTOOL_DEFAULT"; then
345             DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
346           fi
347           DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
348           ;;
349         mep-*)
350           OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
351           ;;
352         esac
354         # Add objdump private vectors.
355         case $targ in
356         powerpc-*-aix*)
357         od_vectors="$od_vectors objdump_private_desc_xcoff"
358           ;;
359         esac
360     fi
361 done
363 # Uniq objdump private vector, build objdump target ofiles.
364 od_files=
365 f=""
366 for i in $od_vectors ; do
367     case " $f " in
368     *" $i "*) ;;
369     *)
370         f="$f $i"
371         OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
372         case $i in
373         objdump_private_desc_xcoff)
374             od_files="$od_files od-xcoff" ;;
375         *) AC_MSG_ERROR(*** unknown private vector $i) ;;
376         esac
377         ;;
378     esac
379 done
381 # Uniq objdump target ofiles
382 f=""
383 for i in $od_files ; do
384     case " $f " in
385     *" $i "*) ;;
386     *)
387         f="$f $i"
388         OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
389         ;;
390     esac
391 done
393 DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
395 if test "${with_windres+set}" = set; then
396           BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
399 if test "${with_windmc+set}" = set; then
400           BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
403 OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
405 AC_SUBST(NLMCONV_DEFS)
406 AC_SUBST(BUILD_NLMCONV)
407 AC_SUBST(BUILD_SRCONV)
408 AC_SUBST(BUILD_DLLTOOL)
409 AC_SUBST(DLLTOOL_DEFS)
410 AC_SUBST(BUILD_WINDRES)
411 AC_SUBST(BUILD_WINDMC)
412 AC_SUBST(BUILD_DLLWRAP)
413 AC_SUBST(BUILD_MISC)
414 AC_SUBST(BUILD_INSTALL_MISC)
415 AC_SUBST(OBJDUMP_DEFS)
416 AC_SUBST(OBJDUMP_PRIVATE_OFILES)
418 AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
420 targ=$target
421 . $srcdir/../bfd/config.bfd
422 if test "x$targ_underscore" = "xyes"; then
423     UNDERSCORE=1
424 else
425     UNDERSCORE=0
427 AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
428  [Define to 1 if user symbol names have a leading underscore, 0 if not.])
430 # Emulation 
431 targ=$target
432 . ${srcdir}/configure.tgt
433 EMULATION=$targ_emul
434 EMULATION_VECTOR=$targ_emul_vector      
436 AC_SUBST(EMULATION)
437 AC_SUBST(EMULATION_VECTOR)
439 # Required for html and install-html
440 AC_SUBST(datarootdir)
441 AC_SUBST(docdir)
442 AC_SUBST(htmldir)
443 AC_SUBST(pdfdir)
445 AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
446 AC_OUTPUT