1 dnl Process this file with autoconf to produce a configure script
7 [ --enable-targets alternative target configurations],
8 [case "${enableval}" in
9 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
11 no) enable_targets= ;;
12 *) enable_targets=$enableval ;;
15 [ --enable-shared build shared BFD library],
16 [case "${enableval}" in
22 AC_ARG_ENABLE(64-bit-bfd,
23 [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
24 [case "${enableval}" in
27 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
28 esac],[want64=false])dnl
30 AC_CONFIG_HEADER(config.h:config.in)
32 AC_CONFIG_AUX_DIR(`cd $srcdir/..; pwd`)
34 if test -z "$target" ; then
35 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
37 if test -z "$host" ; then
38 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
42 # host-specific stuff:
49 . ${srcdir}/configure.host
53 AC_SUBST(RPATH_ENVVAR)
55 AC_SUBST(HOSTING_CRT0)
56 AC_SUBST(HOSTING_LIBS)
57 AC_SUBST(NATIVE_LIB_DIRS)
59 # For most hosts we can use a simple definition to pick up the BFD and
60 # opcodes libraries. However, if we are building shared libraries, we
61 # need to handle some hosts specially.
62 BFDLIB='-L../bfd -lbfd'
65 # On SunOS, we must link against the name we are going to install,
66 # not -lbfd, since SunOS does not support SONAME.
67 if test "${shared}" = "true"; then
68 BFDLIB='-L../bfd -l`echo bfd | sed '"'"'$(program_transform_name)'"'"'`'
72 # On Alpha OSF/1, the native linker searches all the -L
73 # directories for any LIB.so files, and only then searches for any
74 # LIB.a files. That means that if there is an installed
75 # libbfd.so, but this build is not done with --enable-shared, the
76 # link will wind up being against the install libbfd.so rather
77 # than the newly built libbfd. To avoid this, we must explicitly
78 # link against libbfd.a when --enable-shared is not used.
79 if test "${shared}" != "true"; then
80 BFDLIB='../bfd/libbfd.a'
86 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
92 BFD_NEED_DECLARATION(strstr)
93 BFD_NEED_DECLARATION(free)
94 BFD_NEED_DECLARATION(sbrk)
95 BFD_NEED_DECLARATION(getenv)
97 # target-specific stuff:
104 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
106 if test "$targ_alias" = "all"; then
109 # Canonicalize the secondary target names.
110 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ_alias 2>/dev/null`
111 if test -n "$result"; then
117 . ${srcdir}/configure.tgt
119 if test "$targ" = "$target"; then
123 for i in $targ_emul $targ_extra_emuls; do
124 case " $all_emuls " in
127 all_emuls="$all_emuls e${i}.o"
128 eval result=\$tdir_$i
129 test -z "$result" && result=$targ_alias
141 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
142 dnl target, and in those cases we should also build the 64 bit
144 if test x${all_targets} = xtrue; then
145 if test x${want64} = xtrue; then
146 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
148 EMULATION_OFILES='$(ALL_EMULATIONS)'
151 EMULATION_OFILES=$all_emuls
153 AC_SUBST(EMULATION_OFILES)
156 [case x$CONFIG_HEADERS in xconfig.h:config.in) echo > stamp-h ;; esac])