1 dnl Process this file with autoconf to produce a configure script
8 AM_INIT_AUTOMAKE(ld, 2.9.4)
12 AC_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')
17 no) enable_targets= ;;
18 *) enable_targets=$enableval ;;
20 AC_ARG_ENABLE(64-bit-bfd,
21 [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
22 [case "${enableval}" in
25 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
26 esac],[want64=false])dnl
28 AM_CONFIG_HEADER(config.h:config.in)
30 if test -z "$target" ; then
31 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
33 if test -z "$host" ; then
34 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
37 # host-specific stuff:
52 . ${srcdir}/configure.host
55 AC_SUBST(HOSTING_CRT0)
56 AC_SUBST(HOSTING_LIBS)
57 AC_SUBST(NATIVE_LIB_DIRS)
59 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
65 BFD_NEED_DECLARATION(strstr)
66 BFD_NEED_DECLARATION(free)
67 BFD_NEED_DECLARATION(sbrk)
68 BFD_NEED_DECLARATION(getenv)
70 # target-specific stuff:
77 dnl We need to get an arbitrary number of tdir definitions into
78 dnl Makefile. We can't do it using AC_SUBST, because autoconf does
79 dnl not permit literal newlines in an AC_SUBST variables. So we use a
83 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
85 if test "$targ_alias" = "all"; then
88 # Canonicalize the secondary target names.
89 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null`
90 if test -n "$result"; then
96 . ${srcdir}/configure.tgt
98 if test "$targ" = "$target"; then
102 for i in $targ_emul $targ_extra_emuls; do
103 case " $all_emuls " in
106 all_emuls="$all_emuls e${i}.o"
107 eval result=\$tdir_$i
108 test -z "$result" && result=$targ_alias
109 echo tdir_$i=$result >> tdirs
114 for i in $targ_extra_ofiles; do
115 case " $all_emul_extras " in
118 all_emul_extras="$all_emul_extras ${i}"
130 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
131 dnl target, and in those cases we should also build the 64 bit
133 if test x${all_targets} = xtrue; then
134 if test x${want64} = xtrue; then
135 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
137 EMULATION_OFILES='$(ALL_EMULATIONS)'
139 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)'
141 EMULATION_OFILES=$all_emuls
142 EMUL_EXTRA_OFILES=$all_emul_extras
144 AC_SUBST(EMULATION_OFILES)
145 AC_SUBST(EMUL_EXTRA_OFILES)
147 if test x${enable_static} = xno; then
148 TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
150 TESTBFDLIB="../bfd/.libs/libbfd.a"
154 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
155 [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])