(display_debug_lines, case DW_LNS_const_add_pc): Multiply adv by info.li_min_insn_length.
[deliverable/binutils-gdb.git] / libiberty / configure.in
CommitLineData
252b5132
RH
1dnl Process this file with autoconf to produce a configure script
2
3AC_PREREQ(2.12.1)
4AC_INIT(pexecute.c)
5
6dnl We use these options to decide which functions to include.
7AC_ARG_WITH(target-subdir,
8[ --with-target-subdir=SUBDIR Configuring in a subdirectory])
9AC_ARG_WITH(cross-host,
10[ --with-cross-host=HOST Configuring with a cross compiler])
11AC_ARG_WITH(newlib,
12[ --with-newlib Configuring with newlib])
13
14if test "${srcdir}" = "."; then
15 if test -z "${with_target_subdir}"; then
16 libiberty_topdir="${srcdir}/.."
17 else
18 if test "${with_target_subdir}" != "."; then
19 libiberty_topdir="${srcdir}/${with_multisrctop}../.."
20 else
21 libiberty_topdir="${srcdir}/${with_multisrctop}.."
22 fi
23 fi
24else
25 libiberty_topdir="${srcdir}/.."
26fi
27AC_CONFIG_AUX_DIR($libiberty_topdir)
28
29AC_CANONICAL_HOST
30
31dnl When we start using automake:
32dnl AM_INIT_AUTOMAKE(libiberty, 1.0)
33
34dnl These must be called before AM_PROG_LIBTOOL, because it may want
35dnl to call AC_CHECK_PROG.
36AC_CHECK_TOOL(AR, ar)
37AC_CHECK_TOOL(RANLIB, ranlib, :)
38
39# FIXME: We temporarily define our own version of AC_PROG_CC. This is
40# copied from autoconf 2.12, but does not call AC_PROG_CC_WORKS. We
41# are probably using a cross compiler, which will not be able to fully
42# link an executable. This should really be fixed in autoconf
43# itself.
44
45AC_DEFUN(LIB_AC_PROG_CC,
46[AC_BEFORE([$0], [AC_PROG_CPP])dnl
47AC_PROVIDE([AC_PROG_CC])
48AC_CHECK_PROG(CC, gcc, gcc)
49if test -z "$CC"; then
50 AC_CHECK_PROG(CC, cc, cc, , , /usr/ucb/cc)
51 test -z "$CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
52fi
53
54AC_PROG_CC_GNU
55
56if test $ac_cv_prog_gcc = yes; then
57 GCC=yes
58dnl Check whether -g works, even if CFLAGS is set, in case the package
59dnl plays around with CFLAGS (such as to build both debugging and
60dnl normal versions of a library), tasteless as that idea is.
61 ac_test_CFLAGS="${CFLAGS+set}"
62 ac_save_CFLAGS="$CFLAGS"
63 CFLAGS=
64 AC_PROG_CC_G
65 if test "$ac_test_CFLAGS" = set; then
66 CFLAGS="$ac_save_CFLAGS"
67 elif test $ac_cv_prog_cc_g = yes; then
68 CFLAGS="-g -O2"
69 else
70 CFLAGS="-O2"
71 fi
72else
73 GCC=
74 test "${CFLAGS+set}" = set || CFLAGS="-g"
75fi
76])
77
78LIB_AC_PROG_CC
79
80AC_ISC_POSIX
81
82dnl When we start using libtool:
83dnl Default to a non shared library. This may be overridden by the
84dnl configure option --enable-shared.
85dnl AM_DISABLE_SHARED
86
87dnl When we start using libtool:
88dnl AM_PROG_LIBTOOL
89
90dnl When we start using automake:
91dnl AM_CONFIG_HEADER(config.h:config.in)
92AC_CONFIG_HEADER(config.h:config.in)
93
94dnl When we start using automake:
95dnl AM_MAINTAINER_MODE
96dnl AC_EXEEXT
97
98dnl When we start using automake:
99dnl AM_PROG_INSTALL
100AC_PROG_INSTALL
101
102. ${srcdir}/config.table
103host_makefile_frag=${frag}
104AC_SUBST_FILE(host_makefile_frag)
105
106# It's OK to check for header files. Although the compiler may not be
107# able to link anything, it had better be able to at least compile
108# something.
33fbbfbc 109AC_CHECK_HEADERS(sys/file.h sys/param.h stdlib.h string.h unistd.h strings.h sys/time.h sys/resource.h)
252b5132
RH
110AC_HEADER_SYS_WAIT
111
112# This is the list of functions which libiberty will provide if they
113# are not available on the host.
114
115funcs="asprintf"
116funcs="$funcs atexit"
117funcs="$funcs basename"
118funcs="$funcs bcmp"
119funcs="$funcs bcopy"
120funcs="$funcs bzero"
121funcs="$funcs calloc"
122funcs="$funcs clock"
123funcs="$funcs getcwd"
124funcs="$funcs getpagesize"
125funcs="$funcs index"
126funcs="$funcs insque"
127funcs="$funcs memchr"
128funcs="$funcs memcmp"
129funcs="$funcs memcpy"
130funcs="$funcs memmove"
131funcs="$funcs memset"
132funcs="$funcs mkstemps"
133funcs="$funcs random"
134funcs="$funcs rename"
135funcs="$funcs rindex"
136funcs="$funcs sigsetmask"
137funcs="$funcs strcasecmp"
138funcs="$funcs strchr"
139funcs="$funcs strdup"
140funcs="$funcs strncasecmp"
141funcs="$funcs strrchr"
142funcs="$funcs strstr"
143funcs="$funcs strtod"
144funcs="$funcs strtol"
145funcs="$funcs strtoul"
146funcs="$funcs tmpnam"
147funcs="$funcs vasprintf"
148funcs="$funcs vfprintf"
149funcs="$funcs vprintf"
150funcs="$funcs vsprintf"
151funcs="$funcs waitpid"
152
153# Also in the old function.def file: alloca, vfork, getopt.
154
155vars="sys_errlist sys_nerr sys_siglist"
156
c1687039 157checkfuncs="getrusage on_exit psignal strerror strsignal sysconf times sbrk"
252b5132
RH
158
159# These are neither executed nor required, but they help keep
160# autoheader happy without adding a bunch of text to acconfig.h.
161if test "x" = "y"; then
162 AC_CHECK_FUNCS(asprintf atexit basename bcmp bcopy bzero calloc clock getcwd)
163 AC_CHECK_FUNCS(getpagesize index insque mkstemps memchr memcmp memcpy memmove)
164 AC_CHECK_FUNCS(memset random rename rindex sigsetmask strcasecmp)
165 AC_CHECK_FUNCS(strchr strdup strncasecmp strrchr strstr strtod strtol)
166 AC_CHECK_FUNCS(strtoul tmpnam vasprintf vfprintf vprintf vsprintf waitpid)
167 AC_DEFINE(HAVE_SYS_ERRLIST)
168 AC_DEFINE(HAVE_SYS_NERR)
169 AC_DEFINE(HAVE_SYS_SIGLIST)
170 AC_CHECK_FUNCS(getrusage on_exit psignal strerror strsignal sysconf times)
c1687039 171 AC_CHECK_FUNCS(sbrk)
252b5132
RH
172fi
173
174# For each of these functions, if the host does not provide the
175# function we want to put FN.o in LIBOBJS, and if the host does
176# provide the function, we want to define HAVE_FN in config.h. Also,
177# if the host does not provide alloca, we set ALLOCA to alloca.o
178
179setobjs=
180if test -n "${with_target_subdir}"; then
181
182 # We are being configured as a target library. AC_REPLACE_FUNCS
183 # may not work correctly, because the compiler may not be able to
184 # link executables. Note that we may still be being configured
185 # native.
186
187 # If we are being configured for newlib, we know which functions
188 # newlib provide and which ones we will be expected to provide.
189
190 if test "x${with_newlib}" = "xyes"; then
191 ALLOCA="alloca.o"
192 LIBOBJS="asprintf.o basename.o insque.o random.o strdup.o vasprintf.o"
193
194 for f in $funcs; do
195 case "$f" in
196 asprintf | basename | insque | random | strdup | vasprintf)
197 ;;
198 *)
199 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
200 AC_DEFINE_UNQUOTED($n)
201 ;;
202 esac
203 done
204
205 # newlib doesnt provide any of the variables in $vars, so we
206 # dont have to check them here.
207
208 # Of the functions in $checkfuncs, newlib only has strerror.
209 AC_DEFINE(HAVE_STRERROR)
210
211 setobjs=yes
212
213 fi
214fi
215
216if test -z "${setobjs}"; then
217 case "${host}" in
218
219 *-*-vxworks*)
220 # Handle VxWorks configuration specially, since on VxWorks the
221 # libraries are actually on the target board, not in the file
222 # system.
223 LIBOBJS="basename.o getpagesize.o insque.o random.o strcasecmp.o"
224 LIBOBJS="$LIBOBJS strncasecmp.o strdup.o vfork.o waitpid.o vasprintf.o"
225 for f in $funcs; do
226 case "$f" in
227 basename | getpagesize | insque | random | strcasecmp)
228 ;;
229 strncasecmp | strdup | vfork | waitpid | vasprintf)
230 ;;
231 *)
232 n=HAVE_`echo $f | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
233 AC_DEFINE_UNQUOTED($n)
234 ;;
235 esac
236 done
237
238 # VxWorks doesn't provide any of the variables in $vars, so we
239 # don't have to check them here.
240
241 # Of the functions in $checkfuncs, VxWorks only has strerror.
242 AC_DEFINE(HAVE_STRERROR)
243
244 setobjs=yes
245 ;;
246
247 esac
248fi
249
250if test -z "${setobjs}"; then
251
252 case "${host}" in
253
254 *-*-cygwin*)
255 # The Cygwin library actually uses a couple of files from
256 # libiberty when it is built. If we are building a native
257 # Cygwin, and we run the tests, we will appear to have these
258 # files. However, when we go on to build winsup, we will wind up
259 # with a library which does not have the files, since they should
260 # have come from libiberty.
261
262 # We handle this by removing the functions the winsup library
263 # provides from our shell variables, so that they appear to be
264 # missing.
265
266 funcs="`echo $funcs | sed -e 's/random//'`"
267 LIBOBJS="$LIBOBJS random.o"
268 vars="`echo $vars | sed -e 's/sys_siglist//'`"
269 checkfuncs="`echo $checkfuncs | sed -e 's/strsignal//' -e 's/psignal//'`"
270 ;;
271
272 *-*-mingw32*)
273 # Under mingw32, sys_nerr and sys_errlist exist, but they are
274 # macros, so the test below won't find them.
275 vars="`echo $vars | sed -e 's/sys_nerr//' -e 's/sys_errlist//'`"
276 AC_DEFINE(HAVE_SYS_NERR)
277 AC_DEFINE(HAVE_SYS_ERRLIST)
278 ;;
279
280 *-*-uwin*)
281 # Under some versions of uwin, vfork is notoriously buggy and the test
282 # can hang configure; on other versions, vfork exists just as a stub.
283 # FIXME: This should be removed once vfork in uwin's runtime is fixed.
284 ac_cv_func_vfork_works=no
285 ;;
286
287 esac
288
289 # We haven't set the list of objects yet. Use the standard autoconf
290 # tests. This will only work if the compiler works.
291 AC_PROG_CC_WORKS
292 AC_REPLACE_FUNCS($funcs)
293 AC_FUNC_ALLOCA
294 AC_FUNC_VFORK
295 if test $ac_cv_func_vfork_works = no; then
296 LIBOBJS="$LIBOBJS vfork.o"
297 fi
298 for v in $vars; do
299 AC_MSG_CHECKING([for $v])
300 AC_CACHE_VAL(libiberty_cv_var_$v,
301 [AC_TRY_LINK([int *p;], [extern int $v; p = &$v;],
302 [eval "libiberty_cv_var_$v=yes"],
303 [eval "libiberty_cv_var_$v=no"])])
304 if eval "test \"`echo '$libiberty_cv_var_'$v`\" = yes"; then
305 AC_MSG_RESULT(yes)
306 n=HAVE_`echo $v | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`
307 AC_DEFINE_UNQUOTED($n)
308 else
309 AC_MSG_RESULT(no)
310 fi
311 done
312 AC_CHECK_FUNCS($checkfuncs)
313fi
314
315# Install a library built with a cross compiler in $(tooldir) rather
316# than $(libdir).
317if test -z "${with_cross_host}"; then
318 INSTALL_DEST=libdir
319else
320 INSTALL_DEST=tooldir
321fi
322AC_SUBST(INSTALL_DEST)
323
324# We need multilib support, but only if configuring for the target.
325AC_OUTPUT(Makefile,
326[test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h
327if test -n "$CONFIG_FILES"; then
328 if test -n "${with_target_subdir}"; then
329 # FIXME: We shouldn't need to set ac_file
330 ac_file=Makefile
331 . ${libiberty_topdir}/config-ml.in
332 fi
333fi],
334srcdir=${srcdir}
335host=${host}
336target=${target}
337with_target_subdir=${with_target_subdir}
338with_multisubdir=${with_multisubdir}
339ac_configure_args="--enable-multilib ${ac_configure_args}"
340CONFIG_SHELL=${CONFIG_SHELL-/bin/sh}
341libiberty_topdir=${libiberty_topdir}
342)
This page took 0.040575 seconds and 4 git commands to generate.