Fix error message strings so that they can be translated properly.
[deliverable/binutils-gdb.git] / binutils / configure.ac
... / ...
CommitLineData
1dnl Process this file with autoconf to produce a configure script.
2dnl
3dnl Copyright (C) 2012-2014 Free Software Foundation, Inc.
4dnl
5dnl This file is free software; you can redistribute it and/or modify
6dnl it under the terms of the GNU General Public License as published by
7dnl the Free Software Foundation; either version 3 of the License, or
8dnl (at your option) any later version.
9dnl
10dnl This program is distributed in the hope that it will be useful,
11dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
12dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13dnl GNU General Public License for more details.
14dnl
15dnl You should have received a copy of the GNU General Public License
16dnl along with this program; see the file COPYING3. If not see
17dnl <http://www.gnu.org/licenses/>.
18dnl
19
20AC_PREREQ(2.59)
21m4_include([../bfd/version.m4])
22AC_INIT([binutils], BFD_VERSION)
23AC_CONFIG_SRCDIR(ar.c)
24
25AC_CANONICAL_TARGET
26AC_ISC_POSIX
27
28AM_INIT_AUTOMAKE
29
30AC_PROG_CC
31AC_GNU_SOURCE
32AC_USE_SYSTEM_EXTENSIONS
33
34LT_INIT
35ACX_LARGEFILE
36
37AC_ARG_ENABLE(targets,
38[ --enable-targets alternative target configurations],
39[case "${enableval}" in
40 yes | "") AC_MSG_ERROR(enable-targets option must specify target names or 'all')
41 ;;
42 no) enable_targets= ;;
43 *) enable_targets=$enableval ;;
44esac])dnl
45
46AC_ARG_ENABLE(deterministic-archives,
47[AS_HELP_STRING([--enable-deterministic-archives],
48 [ar and ranlib default to -D behavior])], [
49if test "${enableval}" = no; then
50 default_ar_deterministic=0
51else
52 default_ar_deterministic=1
53fi], [default_ar_deterministic=0])
54
55AC_DEFINE_UNQUOTED(DEFAULT_AR_DETERMINISTIC, $default_ar_deterministic,
56 [Should ar and ranlib use -D behavior by default?])
57
58AM_BINUTILS_WARNINGS
59
60AC_CONFIG_HEADERS(config.h:config.in)
61
62AH_VERBATIM([00_CONFIG_H_CHECK],
63[/* Check that config.h is #included before system headers
64 (this works only for glibc, but that should be enough). */
65#if defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__CONFIG_H__)
66# error config.h must be #included before system headers
67#endif
68#define __CONFIG_H__ 1])
69
70if test -z "$target" ; then
71 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
72fi
73if test -z "$host" ; then
74 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
75fi
76
77AC_PROG_YACC
78AM_PROG_LEX
79
80ALL_LINGUAS="bg da es fi fr id it ja ro ru rw sk sv tr uk vi zh_CN zh_TW hr"
81ZW_GNU_GETTEXT_SISTER_DIR
82AM_PO_SUBDIRS
83
84AM_MAINTAINER_MODE
85AM_CONDITIONAL(GENINSRC_NEVER, false)
86AC_EXEEXT
87if test -n "$EXEEXT"; then
88 AC_DEFINE(HAVE_EXECUTABLE_SUFFIX, 1,
89 [Does the platform use an executable suffix?])
90fi
91AC_DEFINE_UNQUOTED(EXECUTABLE_SUFFIX, "${EXEEXT}",
92 [Suffix used for executables, if any.])
93
94# host-specific stuff:
95
96HDEFINES=
97
98. ${srcdir}/../bfd/configure.host
99
100AC_SUBST(HDEFINES)
101AR=${AR-ar}
102AC_SUBST(AR)
103AC_PROG_RANLIB
104AC_PROG_INSTALL
105
106BFD_CC_FOR_BUILD
107
108DEMANGLER_NAME=c++filt
109case "${host}" in
110 *-*-go32* | *-*-msdos*)
111 DEMANGLER_NAME=cxxfilt
112esac
113AC_SUBST(DEMANGLER_NAME)
114
115AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h fcntl.h sys/file.h limits.h locale.h sys/param.h wchar.h)
116AC_HEADER_SYS_WAIT
117ACX_HEADER_STRING
118AC_FUNC_ALLOCA
119AC_CHECK_FUNCS(sbrk utimes setmode getc_unlocked strcoll setlocale)
120AC_CHECK_FUNC([mkstemp],
121 AC_DEFINE([HAVE_MKSTEMP], 1,
122 [Define to 1 if you have the `mkstemp' function.]))
123AC_CHECK_FUNC([mkdtemp],
124 AC_DEFINE([HAVE_MKDTEMP], 1,
125 [Define to 1 if you have the `mkdtemp' function.]))
126 AC_MSG_CHECKING([for mbstate_t])
127 AC_TRY_COMPILE([#include <wchar.h>],
128 [mbstate_t teststate;],
129 have_mbstate_t=yes, have_mbstate_t=no)
130 AC_MSG_RESULT($have_mbstate_t)
131 if test x"$have_mbstate_t" = xyes; then
132 AC_DEFINE(HAVE_MBSTATE_T,1,[Define if mbstate_t exists in wchar.h.])
133 fi
134
135# Some systems have frexp only in -lm, not in -lc.
136AC_SEARCH_LIBS(frexp, m)
137
138AM_LC_MESSAGES
139
140AC_MSG_CHECKING(for time_t in time.h)
141AC_CACHE_VAL(bu_cv_decl_time_t_time_h,
142[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <time.h>], [time_t i;])],
143bu_cv_decl_time_t_time_h=yes, bu_cv_decl_time_t_time_h=no)])
144AC_MSG_RESULT($bu_cv_decl_time_t_time_h)
145if test $bu_cv_decl_time_t_time_h = yes; then
146 AC_DEFINE([HAVE_TIME_T_IN_TIME_H], 1,
147 [Is the type time_t defined in <time.h>?])
148fi
149
150AC_MSG_CHECKING(for time_t in sys/types.h)
151AC_CACHE_VAL(bu_cv_decl_time_t_types_h,
152[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>], [time_t i;])],
153bu_cv_decl_time_t_types_h=yes, bu_cv_decl_time_t_types_h=no)])
154AC_MSG_RESULT($bu_cv_decl_time_t_types_h)
155if test $bu_cv_decl_time_t_types_h = yes; then
156 AC_DEFINE([HAVE_TIME_T_IN_TYPES_H], 1,
157 [Is the type time_t defined in <sys/types.h>?])
158fi
159
160AC_MSG_CHECKING(for a known getopt prototype in unistd.h)
161AC_CACHE_VAL(bu_cv_decl_getopt_unistd_h,
162[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>], [extern int getopt (int, char *const*, const char *);])],
163bu_cv_decl_getopt_unistd_h=yes, bu_cv_decl_getopt_unistd_h=no)])
164AC_MSG_RESULT($bu_cv_decl_getopt_unistd_h)
165if test $bu_cv_decl_getopt_unistd_h = yes; then
166 AC_DEFINE([HAVE_DECL_GETOPT], 1,
167 [Is the prototype for getopt in <unistd.h> in the expected format?])
168fi
169
170# Under Next 3.2 <utime.h> apparently does not define struct utimbuf
171# by default.
172AC_MSG_CHECKING([for utime.h])
173AC_CACHE_VAL(bu_cv_header_utime_h,
174[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <sys/types.h>
175#ifdef HAVE_TIME_H
176#include <time.h>
177#endif
178#include <utime.h>],
179[struct utimbuf s;])],
180bu_cv_header_utime_h=yes, bu_cv_header_utime_h=no)])
181AC_MSG_RESULT($bu_cv_header_utime_h)
182if test $bu_cv_header_utime_h = yes; then
183 AC_DEFINE(HAVE_GOOD_UTIME_H, 1, [Does <utime.h> define struct utimbuf?])
184fi
185
186AC_CHECK_DECLS([environ, fprintf, getc_unlocked, getenv,
187 sbrk, snprintf, stpcpy, strnlen, strstr, vsnprintf])
188
189# Link in zlib if we can. This allows us to read compressed debug
190# sections. This is used only by readelf.c (objdump uses bfd for
191# reading compressed sections).
192AM_ZLIB
193
194BFD_BINARY_FOPEN
195
196# target-specific stuff:
197
198# Canonicalize the secondary target names.
199if test -n "$enable_targets"; then
200 for targ in `echo $enable_targets | sed 's/,/ /g'`
201 do
202 result=`$ac_config_sub $targ 2>/dev/null`
203 if test -n "$result"; then
204 canon_targets="$canon_targets $result"
205 else
206 # Allow targets that config.sub doesn't recognize, like "all".
207 canon_targets="$canon_targets $targ"
208 fi
209 done
210fi
211
212AC_CHECK_HEADER(iconv.h)
213AM_ICONV
214
215all_targets=false
216BUILD_NLMCONV=
217NLMCONV_DEFS=
218BUILD_SRCONV=
219BUILD_DLLTOOL=
220DLLTOOL_DEFS=
221DLLTOOL_DEFAULT=
222BUILD_WINDRES=
223BUILD_WINDMC=
224BUILD_DLLWRAP=
225BUILD_MISC=
226BUILD_INSTALL_MISC=
227OBJDUMP_DEFS=
228OBJDUMP_PRIVATE_VECTORS=
229OBJDUMP_PRIVATE_OFILES=
230od_vectors=
231
232for targ in $target $canon_targets
233do
234 if test "x$targ" = "xall"; then
235 all_targets=true
236 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
237 BUILD_SRCONV='$(SRCONV_PROG)'
238 NLMCONV_DEFS="-DNLMCONV_I386 -DNLMCONV_ALPHA -DNLMCONV_POWERPC -DNLMCONV_SPARC"
239 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
240 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
241 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
242 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
243 if test -z "$DLLTOOL_DEFAULT"; then
244 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
245 fi
246 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
247 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
248 od_vectors="$od_vectors objdump_private_desc_xcoff"
249 else
250 case $targ in
251changequote(,)dnl
252 i[3-7]86*-*-netware*)
253changequote([,])dnl
254 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
255 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_I386"
256 ;;
257 alpha*-*-netware*)
258 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
259 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_ALPHA"
260 ;;
261 powerpc*-*-netware*)
262 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
263 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_POWERPC"
264 ;;
265 sparc*-*-netware*)
266 BUILD_NLMCONV='$(NLMCONV_PROG)$(EXEEXT)'
267 NLMCONV_DEFS="$NLMCONV_DEFS -DNLMCONV_SPARC"
268 ;;
269 esac
270
271 case $targ in
272 *-*-hms*) BUILD_SRCONV='$(SRCONV_PROG)' ;;
273 esac
274
275 case $targ in
276 arm-epoc-pe*)
277 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
278 if test -z "$DLLTOOL_DEFAULT"; then
279 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_EPOC"
280 fi
281 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_EPOC -DDLLTOOL_ARM"
282 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
283 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
284 ;;
285 arm-wince-pe* | arm-*-wince | arm*-*-cegcc* | arm*-*-mingw32ce*)
286 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
287 if test -z "$DLLTOOL_DEFAULT"; then
288 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM_WINCE"
289 fi
290 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM_WINCE -DDLLTOOL_ARM"
291 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
292 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
293 ;;
294 arm-*-pe*)
295 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
296 if test -z "$DLLTOOL_DEFAULT"; then
297 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_ARM"
298 fi
299 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_ARM"
300 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
301 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
302 ;;
303 x86_64-*-mingw* | x86_64-*-cygwin*)
304 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
305 if test -z "$DLLTOOL_DEFAULT"; then
306 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MX86_64"
307 fi
308 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MX86_64"
309 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
310 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
311 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
312 ;;
313changequote(,)dnl
314 i[3-7]86-*-pe* | i[3-7]86-*-cygwin* | i[3-7]86-*-mingw32** | i[3-7]86-*-netbsdpe*)
315changequote([,])dnl
316 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
317 if test -z "$DLLTOOL_DEFAULT"; then
318 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
319 fi
320 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
321 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
322 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
323 BUILD_DLLWRAP='$(DLLWRAP_PROG)$(EXEEXT)'
324 ;;
325changequote(,)dnl
326 i[3-7]86-*-interix)
327changequote([,])dnl
328 BUILD_DLLTOOL='$(DLLTOOL_PROG)'
329 if test -z "$DLLTOOL_DEFAULT"; then
330 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_I386"
331 fi
332 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_I386"
333 ;;
334changequote(,)dnl
335 powerpc*-aix5.[01])
336changequote([,])dnl
337 ;;
338changequote(,)dnl
339 powerpc*-aix[5-9].*)
340changequote([,])dnl
341 OBJDUMP_DEFS="-DAIX_WEAK_SUPPORT"
342 ;;
343 powerpc*-*-pe* | powerpc*-*-cygwin*)
344 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
345 if test -z "$DLLTOOL_DEFAULT"; then
346 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_PPC"
347 fi
348 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_PPC"
349 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
350 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
351 ;;
352 powerpc*-*-linux* | powerpc*-*-elf* | powerpc*-*-eabi*)
353 case "$BUILD_INSTALL_MISC" in
354 *embedspu*) ;;
355 *) BUILD_INSTALL_MISC="${BUILD_INSTALL_MISC} embedspu"
356 esac
357 ;;
358 sh*-*-pe)
359 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
360 if test -z "$DLLTOOL_DEFAULT"; then
361 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_SH"
362 fi
363 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_SH"
364 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
365 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
366 ;;
367 spu-*-*)
368 BUILD_MISC="${BUILD_MISC} "'bin2c$(EXEEXT_FOR_BUILD)'
369 ;;
370 mips*-*-pe)
371 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
372 if test -z "$DLLTOOL_DEFAULT"; then
373 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MIPS"
374 fi
375 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MIPS"
376 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
377 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
378 ;;
379 mcore-*-pe)
380 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
381 if test -z "$DLLTOOL_DEFAULT"; then
382 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE"
383 fi
384 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE"
385 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
386 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
387 ;;
388 mcore-*-elf)
389 BUILD_DLLTOOL='$(DLLTOOL_PROG)$(EXEEXT)'
390 if test -z "$DLLTOOL_DEFAULT"; then
391 DLLTOOL_DEFAULT="-DDLLTOOL_DEFAULT_MCORE_ELF"
392 fi
393 DLLTOOL_DEFS="$DLLTOOL_DEFS -DDLLTOOL_MCORE_ELF"
394 ;;
395 mep-*)
396 OBJDUMP_DEFS="-DSKIP_ZEROES=256 -DSKIP_ZEROES_AT_END=0"
397 ;;
398 esac
399
400 # Add objdump private vectors.
401 case $targ in
402 powerpc-*-aix*)
403 od_vectors="$od_vectors objdump_private_desc_xcoff"
404 ;;
405 *-*-darwin*)
406 od_vectors="$od_vectors objdump_private_desc_mach_o"
407 ;;
408 esac
409 fi
410done
411
412# Uniq objdump private vector, build objdump target ofiles.
413od_files=
414f=""
415for i in $od_vectors ; do
416 case " $f " in
417 *" $i "*) ;;
418 *)
419 f="$f $i"
420 OBJDUMP_PRIVATE_VECTORS="$OBJDUMP_PRIVATE_VECTORS &$i,"
421 case $i in
422 objdump_private_desc_xcoff)
423 od_files="$od_files od-xcoff" ;;
424 objdump_private_desc_mach_o)
425 od_files="$od_files od-macho" ;;
426 *) AC_MSG_ERROR(*** unknown private vector $i) ;;
427 esac
428 ;;
429 esac
430done
431
432# Uniq objdump target ofiles
433f=""
434for i in $od_files ; do
435 case " $f " in
436 *" $i "*) ;;
437 *)
438 f="$f $i"
439 OBJDUMP_PRIVATE_OFILES="$OBJDUMP_PRIVATE_OFILES $i.$objext"
440 ;;
441 esac
442done
443
444DLLTOOL_DEFS="$DLLTOOL_DEFS $DLLTOOL_DEFAULT"
445
446if test "${with_windres+set}" = set; then
447 BUILD_WINDRES='$(WINDRES_PROG)$(EXEEXT)'
448fi
449
450if test "${with_windmc+set}" = set; then
451 BUILD_WINDMC='$(WINDMC_PROG)$(EXEEXT)'
452fi
453
454OBJDUMP_DEFS="${OBJDUMP_DEFS} -DOBJDUMP_PRIVATE_VECTORS=\"${OBJDUMP_PRIVATE_VECTORS}\""
455
456AC_SUBST(NLMCONV_DEFS)
457AC_SUBST(BUILD_NLMCONV)
458AC_SUBST(BUILD_SRCONV)
459AC_SUBST(BUILD_DLLTOOL)
460AC_SUBST(DLLTOOL_DEFS)
461AC_SUBST(BUILD_WINDRES)
462AC_SUBST(BUILD_WINDMC)
463AC_SUBST(BUILD_DLLWRAP)
464AC_SUBST(BUILD_MISC)
465AC_SUBST(BUILD_INSTALL_MISC)
466AC_SUBST(OBJDUMP_DEFS)
467AC_SUBST(OBJDUMP_PRIVATE_OFILES)
468
469AC_DEFINE_UNQUOTED(TARGET, "${target}", [Configured target name.])
470
471targ=$target
472. $srcdir/../bfd/config.bfd
473if test "x$targ_underscore" = "xyes"; then
474 UNDERSCORE=1
475else
476 UNDERSCORE=0
477fi
478AC_DEFINE_UNQUOTED(TARGET_PREPENDS_UNDERSCORE, $UNDERSCORE,
479 [Define to 1 if user symbol names have a leading underscore, 0 if not.])
480
481# Emulation
482targ=$target
483. ${srcdir}/configure.tgt
484EMULATION=$targ_emul
485EMULATION_VECTOR=$targ_emul_vector
486
487AC_SUBST(EMULATION)
488AC_SUBST(EMULATION_VECTOR)
489
490# Required for html and install-html
491AC_SUBST(datarootdir)
492AC_SUBST(docdir)
493AC_SUBST(htmldir)
494AC_SUBST(pdfdir)
495
496AC_CONFIG_FILES(Makefile doc/Makefile po/Makefile.in:po/Make-in)
497AC_OUTPUT
This page took 0.024052 seconds and 4 git commands to generate.