1 dnl Process this file with autoconf to produce a configure script
10 BFD_VERSION=`sed -n -e 's/^.._INIT_AUTOMAKE.*,[ ]*\([^ ]*\)[ ]*).*/\1/p' < ${srcdir}/../bfd/configure.in`
12 AM_INIT_AUTOMAKE(ld, ${BFD_VERSION})
16 AC_ARG_ENABLE(targets,
17 [ --enable-targets alternative target configurations],
18 [case "${enableval}" in
19 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
21 no) enable_targets= ;;
22 *) enable_targets=$enableval ;;
24 AC_ARG_ENABLE(64-bit-bfd,
25 [ --enable-64-bit-bfd 64-bit support (on hosts with narrower word sizes)],
26 [case "${enableval}" in
29 *) AC_MSG_ERROR(bad value ${enableval} for 64-bit-bfd option) ;;
30 esac],[want64=false])dnl
32 build_warnings="-W -Wall -Wstrict-prototypes -Wmissing-prototypes"
33 AC_ARG_ENABLE(build-warnings,
34 [ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
35 [case "${enableval}" in
37 no) build_warnings="-w";;
38 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
39 build_warnings="${build_warnings} ${t}";;
40 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
41 build_warnings="${t} ${build_warnings}";;
42 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
44 if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
45 echo "Setting warning flags = $build_warnings" 6>&1
48 if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
49 WARN_CFLAGS="${build_warnings}"
53 AM_CONFIG_HEADER(config.h:config.in)
55 if test -z "$target" ; then
56 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
58 if test -z "$host" ; then
59 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
62 # host-specific stuff:
67 ALL_LINGUAS="fr sv tr es"
77 . ${srcdir}/configure.host
80 AC_SUBST(HOSTING_CRT0)
81 AC_SUBST(HOSTING_LIBS)
82 AC_SUBST(NATIVE_LIB_DIRS)
84 AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
90 BFD_NEED_DECLARATION(strstr)
91 BFD_NEED_DECLARATION(free)
92 BFD_NEED_DECLARATION(sbrk)
93 BFD_NEED_DECLARATION(getenv)
94 BFD_NEED_DECLARATION(environ)
96 # When converting linker scripts into strings for use in emulation
97 # files, use astring.sed if the compiler supports ANSI string
98 # concatenation, or ostring.sed otherwise. This is to support the
99 # broken Microsoft MSVC compiler, which limits the length of string
100 # constants, while still supporting pre-ANSI compilers which do not
101 # support string concatenation.
102 AC_MSG_CHECKING([whether ANSI C string concatenation works])
103 AC_CACHE_VAL(ld_cv_string_concatenation,
104 [AC_TRY_COMPILE(,[char *a = "a" "a";],
105 [ld_cv_string_concatenation=yes],
106 [ld_cv_string_concatenation=no])])
107 AC_MSG_RESULT($ld_cv_string_concatenation)
108 if test "$ld_cv_string_concatenation" = "yes"; then
109 STRINGIFY=astring.sed
111 STRINGIFY=ostring.sed
115 # target-specific stuff:
123 dnl We need to get an arbitrary number of tdir definitions into
124 dnl Makefile. We can't do it using AC_SUBST, because autoconf does
125 dnl not permit literal newlines in an AC_SUBST variables. So we use a
129 for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
131 if test "$targ_alias" = "all"; then
134 # Canonicalize the secondary target names.
135 result=`$ac_config_sub $targ_alias 2>/dev/null`
136 if test -n "$result"; then
142 . ${srcdir}/configure.tgt
144 if test "$targ" = "$target"; then
148 for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
149 case " $all_emuls " in
152 all_emuls="$all_emuls e${i}.o"
153 eval result=\$tdir_$i
154 test -z "$result" && result=$targ_alias
155 echo tdir_$i=$result >> tdirs
160 for i in $targ_emul $targ_extra_libpath; do
161 case " $all_libpath " in
164 if test -z "$all_libpath"; then
167 all_libpath="$all_libpath ${i}"
173 for i in $targ_extra_ofiles; do
174 case " $all_emul_extras " in
177 all_emul_extras="$all_emul_extras ${i}"
189 dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
190 dnl target, and in those cases we should also build the 64 bit
192 if test x${all_targets} = xtrue; then
193 if test x${want64} = xtrue; then
194 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
196 EMULATION_OFILES='$(ALL_EMULATIONS)'
198 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)'
200 EMULATION_OFILES=$all_emuls
201 EMUL_EXTRA_OFILES=$all_emul_extras
203 AC_SUBST(EMULATION_OFILES)
204 AC_SUBST(EMUL_EXTRA_OFILES)
206 EMULATION_LIBPATH=$all_libpath
207 AC_SUBST(EMULATION_LIBPATH)
209 if test x${enable_static} = xno; then
210 TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
212 TESTBFDLIB="../bfd/.libs/libbfd.a"
216 target_vendor=${target_vendor=$host_vendor}
217 case "$target_vendor" in
218 hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
219 *) EXTRA_SHLIB_EXTENSION= ;;
221 if test x${EXTRA_SHLIB_EXTENSION} != x ; then
222 AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION",
223 [Additional extension a shared object might have.])
226 AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
227 [sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])