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