]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - ld/configure.in
2000-09-07 Kazu Hirata <kazu@hxi.com>
[thirdparty/binutils-gdb.git] / ld / configure.in
CommitLineData
252b5132
RH
1dnl Process this file with autoconf to produce a configure script
2dnl
3AC_PREREG(2.13)
4AC_INIT(ldmain.c)
5
6AC_CANONICAL_SYSTEM
7
18e03609 8AM_INIT_AUTOMAKE(ld, 2.10.91)
252b5132
RH
9
10AM_PROG_LIBTOOL
11
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
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
27
a2d91340
AC
28build_warnings="-W -Wall"
29AC_ARG_ENABLE(build-warnings,
30[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
31[case "${enableval}" in
32 yes) ;;
33 no) build_warnings="-w";;
34 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
35 build_warnings="${build_warnings} ${t}";;
36 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
37 build_warnings="${t} ${build_warnings}";;
38 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
39esac
40if test x"$silent" != x"yes" && test x"$build_warnings" != x""; then
41 echo "Setting warning flags = $build_warnings" 6>&1
42fi])dnl
43WARN_CFLAGS=""
44if test "x${build_warnings}" != x -a "x$GCC" = xyes ; then
45 WARN_CFLAGS="${build_warnings}"
46fi
47AC_SUBST(WARN_CFLAGS)
48
252b5132
RH
49AM_CONFIG_HEADER(config.h:config.in)
50
51if test -z "$target" ; then
52 AC_MSG_ERROR(Unrecognized target system type; please check config.sub.)
53fi
54if test -z "$host" ; then
55 AC_MSG_ERROR(Unrecognized host system type; please check config.sub.)
56fi
57
58# host-specific stuff:
59
60AC_PROG_CC
61AC_PROG_INSTALL
62
63ALL_LINGUAS=
64CY_GNU_GETTEXT
65
66AC_EXEEXT
67
68AC_PROG_YACC
69AM_PROG_LEX
70
71AM_MAINTAINER_MODE
72
73. ${srcdir}/configure.host
74
75AC_SUBST(HDEFINES)
76AC_SUBST(HOSTING_CRT0)
77AC_SUBST(HOSTING_LIBS)
78AC_SUBST(NATIVE_LIB_DIRS)
79
80AC_CHECK_HEADERS(string.h strings.h stdlib.h unistd.h)
81AC_CHECK_FUNCS(sbrk)
82AC_HEADER_DIRENT
83
84BFD_BINARY_FOPEN
85
86BFD_NEED_DECLARATION(strstr)
87BFD_NEED_DECLARATION(free)
88BFD_NEED_DECLARATION(sbrk)
89BFD_NEED_DECLARATION(getenv)
90BFD_NEED_DECLARATION(environ)
91
597e2591
ILT
92# When converting linker scripts into strings for use in emulation
93# files, use astring.sed if the compiler supports ANSI string
94# concatenation, or ostring.sed otherwise. This is to support the
95# broken Microsoft MSVC compiler, which limits the length of string
96# constants, while still supporting pre-ANSI compilers which do not
97# support string concatenation.
e4dabd0e 98AC_MSG_CHECKING([whether ANSI C string concatenation works])
597e2591
ILT
99AC_CACHE_VAL(ld_cv_string_concatenation,
100[AC_TRY_COMPILE(,[char *a = "a" "a";],
e4dabd0e
AS
101 [ld_cv_string_concatenation=yes],
102 [ld_cv_string_concatenation=no])])
103AC_MSG_RESULT($ld_cv_string_concatenation)
104if test "$ld_cv_string_concatenation" = "yes"; then
597e2591
ILT
105 STRINGIFY=astring.sed
106else
107 STRINGIFY=ostring.sed
108fi
109AC_SUBST(STRINGIFY)
110
252b5132
RH
111# target-specific stuff:
112
113all_targets=
114EMUL=
115all_emuls=
116all_emul_extras=
ba2be581 117all_libpath=
252b5132
RH
118
119dnl We need to get an arbitrary number of tdir definitions into
120dnl Makefile. We can't do it using AC_SUBST, because autoconf does
121dnl not permit literal newlines in an AC_SUBST variables. So we use a
122dnl file.
123rm -f tdirs
124
125for targ_alias in `echo $target_alias $enable_targets | sed 's/,/ /g'`
126do
127 if test "$targ_alias" = "all"; then
128 all_targets=true
129 else
130 # Canonicalize the secondary target names.
a8100d5b 131 result=`$ac_config_sub $targ_alias 2>/dev/null`
252b5132
RH
132 if test -n "$result"; then
133 targ=$result
134 else
135 targ=$targ_alias
136 fi
137
138 . ${srcdir}/configure.tgt
139
140 if test "$targ" = "$target"; then
141 EMUL=$targ_emul
142 fi
143
3336653a 144 for i in $targ_emul $targ_extra_emuls $targ_extra_libpath; do
252b5132
RH
145 case " $all_emuls " in
146 *" e${i}.o "*) ;;
147 *)
148 all_emuls="$all_emuls e${i}.o"
149 eval result=\$tdir_$i
150 test -z "$result" && result=$targ_alias
151 echo tdir_$i=$result >> tdirs
152 ;;
153 esac
154 done
155
ba2be581 156 for i in $targ_emul $targ_extra_libpath; do
3336653a
RH
157 case " $all_libpath " in
158 *" ${i} "*) ;;
159 *)
ba2be581
RH
160 if test -z "$all_libpath"; then
161 all_libpath=${i}
162 else
163 all_libpath="$all_libpath ${i}"
164 fi
3336653a
RH
165 ;;
166 esac
167 done
168
252b5132
RH
169 for i in $targ_extra_ofiles; do
170 case " $all_emul_extras " in
171 *" ${i} "*) ;;
172 *)
173 all_emul_extras="$all_emul_extras ${i}"
174 ;;
175 esac
176 done
177 fi
178done
179
180AC_SUBST(EMUL)
181
182TDIRS=tdirs
183AC_SUBST_FILE(TDIRS)
184
185dnl FIXME: We will build a 64 bit BFD for a 64 bit host or a 64 bit
186dnl target, and in those cases we should also build the 64 bit
187dnl emulations.
188if test x${all_targets} = xtrue; then
189 if test x${want64} = xtrue; then
190 EMULATION_OFILES='$(ALL_EMULATIONS) $(ALL_64_EMULATIONS)'
191 else
192 EMULATION_OFILES='$(ALL_EMULATIONS)'
193 fi
194 EMUL_EXTRA_OFILES='$(ALL_EMUL_EXTRA_OFILES)'
195else
196 EMULATION_OFILES=$all_emuls
197 EMUL_EXTRA_OFILES=$all_emul_extras
198fi
199AC_SUBST(EMULATION_OFILES)
200AC_SUBST(EMUL_EXTRA_OFILES)
201
3336653a
RH
202EMULATION_LIBPATH=$all_libpath
203AC_SUBST(EMULATION_LIBPATH)
204
252b5132
RH
205if test x${enable_static} = xno; then
206 TESTBFDLIB="--rpath ../bfd/.libs ../bfd/.libs/libbfd.so"
207else
208 TESTBFDLIB="../bfd/.libs/libbfd.a"
209fi
210AC_SUBST(TESTBFDLIB)
211
93a6d436
JL
212target_vendor=${target_vendor=$host_vendor}
213case "$target_vendor" in
214 hp) EXTRA_SHLIB_EXTENSION=".sl" ;;
215 *) EXTRA_SHLIB_EXTENSION= ;;
216esac
217if test x${EXTRA_SHLIB_EXTENSION} != x ; then
218 AC_DEFINE_UNQUOTED(EXTRA_SHLIB_EXTENSION, "$EXTRA_SHLIB_EXTENSION",
219 [Additional extension a shared object might have.])
220fi
221
252b5132
RH
222AC_OUTPUT(Makefile po/Makefile.in:po/Make-in,
223[sed -e '/POTFILES =/r po/POTFILES' po/Makefile.in > po/Makefile])