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