Thu Jan 29 16:04:21 1998 Mumit Khan <khan@xraylith.wisc.edu>
[deliverable/binutils-gdb.git] / ld / configure.in
CommitLineData
ef346f1a
ILT
1dnl Process this file with autoconf to produce a configure script
2dnl
b9a5c27f 3AC_PREREG(2.5)
ef346f1a
ILT
4AC_INIT(ldmain.c)
5
49c009b5
ILT
6AC_CANONICAL_SYSTEM
7
8AM_INIT_AUTOMAKE(ld, 2.8.2)
9
10AM_PROG_LIBTOOL
11
ef346f1a
ILT
12AC_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 ;;
19esac])dnl
b9a5c27f
RS
20AC_ARG_ENABLE(64-bit-bfd,
21[ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
22[case "${enableval}" in
23 yes) want64=true ;;
24 no) want64=false ;;
25 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
26esac],[want64=false])dnl
ef346f1a 27
49c009b5 28AM_CONFIG_HEADER(config.h:config.in)
ef346f1a 29
ef346f1a
ILT
30if test -z "$target" ; then
31 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
32fi
33if test -z "$host" ; then
34 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
35fi
02757e59 36
ef346f1a 37# host-specific stuff:
02757e59 38
7e19f60e 39AC_PROG_CC
49c009b5
ILT
40AM_PROG_INSTALL
41AM_CYGWIN32
42AM_EXEEXT
43
44AC_PROG_YACC
45AC_PROG_LEX
46AC_DECL_YYTEXT
47
48AM_MAINTAINER_MODE
7e19f60e 49
ef346f1a 50. ${srcdir}/configure.host
02757e59 51
ef346f1a
ILT
52AC_SUBST(HDEFINES)
53AC_SUBST(HOSTING_CRT0)
54AC_SUBST(HOSTING_LIBS)
55AC_SUBST(NATIVE_LIB_DIRS)
8ddef552 56
ef346f1a
ILT
57AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
58AC_CHECK_FUNCS(sbrk)
2e598345 59AC_HEADER_DIRENT
ab57b174 60
ef346f1a 61BFD_BINARY_FOPEN
02757e59 62
b9a5c27f 63BFD_NEED_DECLARATION(strstr)
2e598345 64BFD_NEED_DECLARATION(free)
b9a5c27f
RS
65BFD_NEED_DECLARATION(sbrk)
66BFD_NEED_DECLARATION(getenv)
2e598345 67
ef346f1a 68# target-specific stuff:
02757e59 69
95d31c3c 70all_targets=
ef346f1a
ILT
71EMUL=
72all_emuls=
95d31c3c 73TDIRS=
1c4b3cda 74
95d31c3c 75for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
1c4b3cda 76do
95d31c3c
ILT
77 if test "$targ_alias" = "all"; then
78 all_targets=true
79 else
80 # Canonicalize the secondary target names.
b9a5c27f 81 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null`
95d31c3c
ILT
82 if test -n "$result"; then
83 targ=$result
1c4b3cda 84 else
95d31c3c
ILT
85 targ=$targ_alias
86 fi
7f2649bb 87
95d31c3c 88 . ${srcdir}/configure.tgt
ef346f1a 89
95d31c3c
ILT
90 if test "$targ" = "$target"; then
91 EMUL=$targ_emul
1c4b3cda 92 fi
1c4b3cda 93
95d31c3c
ILT
94 for i in $targ_emul $targ_extra_emuls; do
95 case " $all_emuls " in
96 *" e${i}.o "*) ;;
97 *)
98 all_emuls="$all_emuls e${i}.o"
99 eval result=\$tdir_$i
100 test -z "$result" && result=$targ_alias
101 TDIRS="$TDIRS\\
102tdir_$i=$result"
103 ;;
1c4b3cda
ILT
104 esac
105 done
95d31c3c
ILT
106 fi
107done
1c4b3cda 108
95d31c3c
ILT
109AC_SUBST(EMUL)
110AC_SUBST(TDIRS)
1c4b3cda 111
b9a5c27f
RS
112dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
113dnl target, and in those cases we should also build the 64 bit
114dnl emulations.
95d31c3c 115if test x${all_targets} = xtrue; then
b9a5c27f
RS
116 if test x${want64} = xtrue; then
117 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
118 else
119 EMULATION_OFILES='$(ALL_EMULATIONS)'
120 fi
95d31c3c
ILT
121else
122 EMULATION_OFILES=$all_emuls
123fi
ef346f1a 124AC_SUBST(EMULATION_OFILES)
8ddef552 125
49c009b5 126AC_OUTPUT(Makefile)
This page took 0.353193 seconds and 4 git commands to generate.