import gdb-1999-08-30 snapshot
[deliverable/binutils-gdb.git] / gdb / configure.in
CommitLineData
c906108c
SS
1dnl Autoconf configure script for GDB, the GNU debugger.
2dnl Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
3dnl
4dnl This file is part of GDB.
5dnl
6dnl This program is free software; you can redistribute it and/or modify
7dnl it under the terms of the GNU General Public License as published by
8dnl the Free Software Foundation; either version 2 of the License, or
9dnl (at your option) any later version.
10dnl
11dnl This program is distributed in the hope that it will be useful,
12dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14dnl GNU General Public License for more details.
15dnl
16dnl You should have received a copy of the GNU General Public License
17dnl along with this program; if not, write to the Free Software
18dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20dnl Process this file with autoconf to produce a configure script.
21
22AC_PREREQ(2.13)dnl
23AC_INIT(main.c)
24AC_CONFIG_HEADER(config.h:config.in)
25
26AC_PROG_CC
27AC_AIX
28AC_ISC_POSIX
29AM_PROG_CC_STDC
30
31AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
32AC_CANONICAL_SYSTEM
33
34dnl gdb doesn't use gettext, but bfd does. We call this to ensure we
35dnl link with the correct libraries.
36ALL_LINGUAS=
37CY_GNU_GETTEXT
38
39dnl List of object files added by configure.
40
41CONFIG_OBS=
42CONFIG_DEPS=
43CONFIG_SRCS=
44
45configdirs="doc testsuite"
46
96baa820
JM
47AC_ARG_ENABLE(multi-ice,
48[ --enable-multi-ice Build the multi-ice-gdb-server],
49[case "${enableval}" in
50 yes ) enable_multi_ice="yes" ;;
51 no) enable_multi_ice="no" ;;
52 *) AC_MSG_ERROR(Bad value for --enable-multi-ice: ${enableval}) ;;
53 esac
54])
55
56if test "${enable_multi_ice}" = "yes"; then
57 configdirs="${configdirs} multi-ice"
58fi
59
c906108c
SS
60dnl
61changequote(,)dnl
62
63. ${srcdir}/configure.host
64
65. ${srcdir}/configure.tgt
66
67dnl
68changequote([,])dnl
69
7a292a7a 70AC_PROG_AWK
c906108c
SS
71AC_PROG_INSTALL
72AC_CHECK_TOOL(AR, ar)
73AC_CHECK_TOOL(RANLIB, ranlib, :)
74AC_PROG_YACC
75
76AC_ARG_PROGRAM
77
78AC_TYPE_SIGNAL
79
80AC_HEADER_STDC
81
82AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h \
83 memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
84 string.h sys/procfs.h sys/ptrace.h sys/reg.h \
85 term.h termio.h termios.h unistd.h wait.h sys/wait.h \
104c1213
JM
86 wchar.h wctype.h asm/debugreg.h sys/debugreg.h sys/select.h \
87 time.h)
c906108c
SS
88AC_HEADER_STAT
89
90AC_C_CONST
91
7be570e7 92AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc poll)
c906108c
SS
93AC_FUNC_ALLOCA
94
7be570e7
JM
95AC_CHECK_LIB(socket, socketpair)
96AC_CHECK_FUNCS(socketpair)
97
98
c906108c
SS
99BFD_NEED_DECLARATION(malloc)
100BFD_NEED_DECLARATION(realloc)
101BFD_NEED_DECLARATION(free)
102BFD_NEED_DECLARATION(strerror)
103BFD_NEED_DECLARATION(strdup)
b83266a0 104BFD_NEED_DECLARATION(strstr)
c906108c
SS
105
106
107# The following save_state_t checkery is only necessary for HPUX
108# versions earlier than 10.20. When those fade from memory, this
109# could be expunged. --jsm 1999-03-22
110
111AC_MSG_CHECKING(for HPUX save_state structure)
112AC_EGREP_HEADER(save_state_t, machine/save_state.h,
113 gdb_cv_hpux_savestate=yes, gdb_cv_hpux_savestate=no)
114AC_EGREP_HEADER(ss_wide, machine/save_state.h, gdb_cv_hpux_sswide=yes,
115 gdb_cv_hpux_sswide=no)
116if test $gdb_cv_hpux_savestate = yes
117then
118 AC_DEFINE(HAVE_STRUCT_SAVE_STATE_T, 1)
119fi
120if test $gdb_cv_hpux_sswide = yes
121then
122 AC_DEFINE(HAVE_STRUCT_MEMBER_SS_WIDE, 1)
123fi
124AC_MSG_RESULT($gdb_cv_hpux_sswide)
125
126
127# If we are configured native on GNU/Linux, work around problems with
128# sys/procfs.h
129# Also detect which type of /proc is in use, such as for Unixware.
130
131if test "${target}" = "${host}"; then
7a292a7a 132 gdb_cv_hostos_is_solaris=no
c906108c
SS
133 case "${host}" in
134 i[[3456]]86-*-linux*)
135 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
136 AC_DEFINE(sys_quotactl)
137 ;;
7a292a7a
SS
138 *-*-solaris*)
139 gdb_cv_hostos_is_solaris=yes ;;
c906108c
SS
140 esac
141 AC_MSG_CHECKING(for directory proc entries)
142# The [gdb_host != sun4sol2] hack is because Solaris does provide the
143# multiple procfs files as of Solaris 2.6, but GDB can't use it right now.
7a292a7a
SS
144 if test "$ac_cv_header_sys_procfs_h" = yes -a \
145 "$gdb_cv_hostos_is_solaris" = no \
c906108c
SS
146 -a -d /proc/$$ \
147 -a -f /proc/$$/ctl \
148 -a -f /proc/$$/as \
149 -a -f /proc/$$/map \
150 -a -f /proc/$$/status; then
151 AC_MSG_RESULT(yes)
152 AC_DEFINE(HAVE_MULTIPLE_PROC_FDS)
153 else
154 AC_MSG_RESULT(no)
155 fi
156fi
157
158if test "$ac_cv_header_sys_procfs_h" = yes; then
159 BFD_HAVE_SYS_PROCFS_TYPE(pstatus_t)
160 BFD_HAVE_SYS_PROCFS_TYPE(prrun_t)
161 BFD_HAVE_SYS_PROCFS_TYPE(gregset_t)
162 BFD_HAVE_SYS_PROCFS_TYPE(fpregset_t)
163
164 dnl Check for PIOCSET ioctl entry
165
166 AC_MSG_CHECKING(for PIOCSET ioctl entry in sys/procfs.h)
167 AC_CACHE_VAL(gdb_cv_have_procfs_piocset,
168 [AC_TRY_COMPILE([#include <unistd.h>
169#include <sys/types.h>
170#include <sys/procfs.h>
171], [
172 int dummy;;
173 dummy = ioctl(0, PIOCSET, &dummy);
174 ],
175 gdb_cv_have_procfs_piocset=yes, gdb_cv_have_procfs_piocset=no)])
176 AC_MSG_RESULT($gdb_cv_have_procfs_piocset)
177 if test $gdb_cv_have_procfs_piocset = yes; then
178 AC_DEFINE(HAVE_PROCFS_PIOCSET)
179 fi
180fi
181
182dnl See if host has libm. This is usually needed by simulators.
183AC_CHECK_LIB(m, main)
184
185dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
186dnl
187dnl A bug in GNU ld 2.9.1 causes a problem if we link in -lw
188dnl under Solaris 2.6 because it is some funky empty library.
189dnl So only link in libw if we have to.
190AC_CHECK_LIB(c, wctype,: ,AC_CHECK_LIB(w, wctype))
191
192dnl See if compiler supports "long long" type.
193
194AC_MSG_CHECKING(for long long support in compiler)
195AC_CACHE_VAL(gdb_cv_c_long_long,
196[AC_TRY_COMPILE(, [
197 extern long long foo;
198 switch (foo & 2) { case 0: return 1; }
199],
200gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
201AC_MSG_RESULT($gdb_cv_c_long_long)
202if test $gdb_cv_c_long_long = yes; then
203 AC_DEFINE(CC_HAS_LONG_LONG)
204fi
205
206dnl See if the compiler and runtime support printing long long
207
208AC_MSG_CHECKING(for long long support in printf)
209AC_CACHE_VAL(gdb_cv_printf_has_long_long,
210[AC_TRY_RUN([
211int main () {
212 char buf[32];
213 long long l = 0;
214 l = (l << 16) + 0x0123;
215 l = (l << 16) + 0x4567;
216 l = (l << 16) + 0x89ab;
217 l = (l << 16) + 0xcdef;
218 sprintf (buf, "0x%016llx", l);
219 return (strcmp ("0x0123456789abcdef", buf));
220}],
221gdb_cv_printf_has_long_long=yes,
222gdb_cv_printf_has_long_long=no,
223gdb_cv_printf_has_long_long=no)])
224if test $gdb_cv_printf_has_long_long = yes; then
225 AC_DEFINE(PRINTF_HAS_LONG_LONG)
226fi
227AC_MSG_RESULT($gdb_cv_printf_has_long_long)
228
229dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
230dnl because autoconf complains about cross-compilation issues. However, this
231dnl code uses the same variables as the macro for compatibility.
232
233AC_MSG_CHECKING(for long double support in compiler)
234AC_CACHE_VAL(ac_cv_c_long_double,
235[AC_TRY_COMPILE(, [long double foo;],
236ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
237AC_MSG_RESULT($ac_cv_c_long_double)
238if test $ac_cv_c_long_double = yes; then
239 AC_DEFINE(HAVE_LONG_DOUBLE)
240fi
241
242dnl See if the compiler and runtime support printing long doubles
243
244AC_MSG_CHECKING(for long double support in printf)
245AC_CACHE_VAL(gdb_cv_printf_has_long_double,
246[AC_TRY_RUN([
247int main () {
248 char buf[16];
249 long double f = 3.141592653;
250 sprintf (buf, "%Lg", f);
251 return (strncmp ("3.14159", buf, 7));
252}],
253gdb_cv_printf_has_long_double=yes,
254gdb_cv_printf_has_long_double=no,
255gdb_cv_printf_has_long_double=no)])
256if test $gdb_cv_printf_has_long_double = yes; then
257 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
258fi
259AC_MSG_RESULT($gdb_cv_printf_has_long_double)
260
261dnl See if the compiler and runtime support scanning long doubles
262
263AC_MSG_CHECKING(for long double support in scanf)
264AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
265[AC_TRY_RUN([
266int main () {
267 char *buf = "3.141592653";
268 long double f = 0;
269 sscanf (buf, "%Lg", &f);
270 return !(f > 3.14159 && f < 3.14160);
271}],
272gdb_cv_scanf_has_long_double=yes,
273gdb_cv_scanf_has_long_double=no,
274gdb_cv_scanf_has_long_double=no)])
275if test $gdb_cv_scanf_has_long_double = yes; then
276 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
277fi
278AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
279
280AC_FUNC_MMAP
281
282dnl See if thread_db library is around for Solaris thread debugging. Note that
283dnl we must explicitly test for version 1 of the library because version 0
284dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
285
286dnl Note that we only want this if we are both native (host == target), and
287dnl not doing a canadian cross build (build == host).
288
289if test ${build} = ${host} -a ${host} = ${target} ; then
290 case ${host_os} in
291 hpux*)
292 AC_MSG_CHECKING(for HPUX/OSF thread support)
293 if test -f /usr/include/dce/cma_config.h ; then
294 if test "$GCC" = "yes" ; then
295 AC_MSG_RESULT(yes)
296 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
297 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
298 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
299 else
300 AC_MSG_RESULT(no (suppressed because you are not using GCC))
301 fi
302 else
303 AC_MSG_RESULT(no)
304 fi
305 ;;
306 solaris*)
307 AC_MSG_CHECKING(for Solaris thread debugging library)
308 if test -f /usr/lib/libthread_db.so.1 ; then
309 AC_MSG_RESULT(yes)
310 AC_DEFINE(HAVE_THREAD_DB_LIB)
311 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
312 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
313 AC_CHECK_LIB(dl, dlopen)
314 if test "$GCC" = "yes" ; then
315 # The GNU linker requires the -export-dynamic option to make
316 # all symbols visible in the dynamic symbol table.
317 hold_ldflags=$LDFLAGS
318 AC_MSG_CHECKING(for the ld -export-dynamic flag)
319 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
320 AC_TRY_LINK(, [int i;], found=yes, found=no)
321 LDFLAGS=$hold_ldflags
322 AC_MSG_RESULT($found)
323 if test $found = yes; then
324 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
325 fi
326 fi
327 # Sun randomly tweaked the prototypes in <proc_service.h>
328 # at one point.
329 AC_MSG_CHECKING(if <proc_service.h> is old)
330 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
331 AC_TRY_COMPILE([
332 #include <proc_service.h>
333 ps_err_e ps_pdwrite
334 (struct ps_prochandle*, psaddr_t, const void*, size_t);
335 ],, gdb_cv_proc_service_is_old=no,
336 gdb_cv_proc_service_is_old=yes)
337 ])
338 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
339 if test $gdb_cv_proc_service_is_old = yes; then
340 AC_DEFINE(PROC_SERVICE_IS_OLD)
341 fi
342 else
343 AC_MSG_RESULT(no)
344 fi
345 ;;
346 esac
347 AC_SUBST(CONFIG_LDFLAGS)
348fi
349
350dnl Handle optional features that can be enabled.
351ENABLE_CFLAGS=
352
353AC_ARG_ENABLE(tui,
354[ --enable-tui Enable full-screen terminal user interface],
355[
356 case "${enable_tui}" in
357 yes | no) ;;
358 "") enable_tui=yes ;;
359 *)
360 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
361 ;;
362 esac
363])
364case ${enable_tui} in
365 "yes" )
366 AC_DEFINE(TUI)
367 BUILD_TUI=all-tui
368 TUI_LIBRARY=tui/libtui.a
369 ;;
370 * )
371 BUILD_TUI=
372 TUI_LIBRARY=
373 ;;
374esac
375AC_SUBST(BUILD_TUI)
376AC_SUBST(TUI_LIBRARY)
377
378AC_ARG_ENABLE(netrom,
379[ --enable-netrom Enable NetROM support],
380[case "${enableval}" in
381yes) enable_netrom=yes ;;
382no) enable_netrom=no ;;
383*) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
384esac])
385
386if test "${enable_netrom}" = "yes"; then
387 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
388 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
389fi
390
391AC_ARG_ENABLE(build-warnings,
392[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
393[build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
394case "${enableval}" in
395 yes) ;;
396 no) build_warnings="-w";;
397 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
398 build_warnings="${build_warnings} ${t}";;
399 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
400 build_warnings="${t} ${build_warnings}";;
401 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
402esac],[build_warnings=""])dnl
403
104c1213
JM
404WARN_CFLAGS=""
405WERROR_CFLAGS=""
c906108c
SS
406if test "x${build_warnings}" != x -a "x$GCC" = xyes
407then
104c1213
JM
408 # Separate out the -Werror flag as some files just cannot be
409 # compiled with it enabled.
410 for w in ${build_warnings}; do
411 case $w in
412 -Werr*) WERROR_CFLAGS=-Werror ;;
413 *) WARN_CFLAGS="${WARN_CFLAGS} $w"
414 esac
415 done
c906108c
SS
416fi
417AC_SUBST(WARN_CFLAGS)
104c1213 418AC_SUBST(WERROR_CFLAGS)
c906108c
SS
419
420MMALLOC_CFLAGS=
421MMALLOC=
422AC_SUBST(MMALLOC_CFLAGS)
423AC_SUBST(MMALLOC)
424
425AC_ARG_WITH(mmalloc,
426[ --with-mmalloc Use memory mapped malloc package],
427[case "${withval}" in
428 yes) want_mmalloc=true ;;
429 no) want_mmalloc=false;;
430 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
431esac],[want_mmalloc=false])dnl
432
433if test x$want_mmalloc = xtrue; then
434 AC_DEFINE(USE_MMALLOC)
435 AC_DEFINE(MMCHECK_FORCE)
436 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
437 MMALLOC='../mmalloc/libmmalloc.a'
438fi
439
7a292a7a
SS
440
441# In the Cygwin environment, we need some additional flags.
442AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
443[AC_EGREP_CPP(lose, [
444#if defined (__CYGWIN__) || defined (__CYGWIN32__)
445lose
446#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
447
448DLLTOOL=${DLLTOOL-dlltool}
449WINDRES=${WINDRES-windres}
450AC_SUBST(DLLTOOL)
451AC_SUBST(WINDRES)
452
c906108c 453dnl Figure out which term library to use.
b83266a0
SS
454if test x$gdb_host = xgo32; then
455 TERM_LIB=
456else
c906108c
SS
457if test x$gdb_cv_os_cygwin = xyes; then
458 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
459else
460 TERM_LIB=
461 AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
462 AC_CHECK_LIB(Hcurses, tgetent, TERM_LIB=-lHcurses,
463 AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
464 AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
465 AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
466 AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo))))))
467
468 if test "x$TERM_LIB" = x
469 then
470 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
471 fi
472fi
b83266a0 473fi
c906108c
SS
474AC_SUBST(TERM_LIB)
475
cd0fc7c3
SS
476# libreadline needs libuser32.a in a cygwin environment
477WIN32LIBS=
478if test x$gdb_cv_os_cygwin = xyes; then
479 WIN32LIBS="-luser32"
480fi
481AC_SUBST(WIN32LIBS)
7a292a7a
SS
482
483
c906108c
SS
484AC_PATH_X
485
7a292a7a
SS
486
487# Unlike the sim directory, whether a simulator is linked is controlled by
488# presence of a SIM= and a SIM_OBS= definition in the target '.mt' file.
489# This code just checks for a few cases where we'd like to ignore those
490# definitions, even when they're present in the '.mt' file. These cases
491# are when --disable-sim is specified, or if the simulator directory is
492# not part of the soruce tree.
493#
494AC_ARG_ENABLE(sim,
495[ --enable-sim Link gdb with simulator],
496[echo "enable_sim = $enable_sim";
497 echo "enableval = ${enableval}";
498 case "${enableval}" in
499 yes) ignore_sim=false ;;
500 no) ignore_sim=true ;;
501 *) ignore_sim=false ;;
502 esac],
503[ignore_sim=false])
504
505if test ! -d "${srcdir}/../sim"; then
506 ignore_sim=true
507fi
508
509if test "${ignore_sim}" = "true"; then
510 IGNORE_SIM="SIM="
511 IGNORE_SIM_OBS="SIM_OBS="
512else
513 IGNORE_SIM=""
514 IGNORE_SIM_OBS=""
515 AC_DEFINE(WITH_SIM)
516fi
517AC_SUBST(IGNORE_SIM)
518AC_SUBST(IGNORE_SIM_OBS)
519
c906108c
SS
520AC_SUBST(ENABLE_CFLAGS)
521
522AC_SUBST(CONFIG_OBS)
523AC_SUBST(CONFIG_DEPS)
524AC_SUBST(CONFIG_SRCS)
525
526# Begin stuff to support --enable-shared
527AC_ARG_ENABLE(shared,
528[ --enable-shared Use shared libraries],
529[case "${enableval}" in
530 yes) shared=true ;;
531 no) shared=false ;;
532 *) shared=true ;;
533esac])dnl
534
535HLDFLAGS=
536HLDENV=
537# If we have shared libraries, try to set rpath reasonably.
538if test "${shared}" = "true"; then
539 case "${host}" in
540 *-*-hpux*)
541 HLDFLAGS='-Wl,+s,+b,$(libdir)'
542 ;;
543 *-*-irix5* | *-*-irix6*)
544 HLDFLAGS='-Wl,-rpath,$(libdir)'
545 ;;
546 *-*-linux*aout*)
547 ;;
548 *-*-linux* | *-pc-linux-gnu)
549 HLDFLAGS='-Wl,-rpath,$(libdir)'
550 ;;
551 *-*-solaris*)
552 HLDFLAGS='-R $(libdir)'
553 ;;
554 *-*-sysv4*)
555 HLDENV='if test -z "$${LD_RUN_PATH}"; then LD_RUN_PATH=$(libdir); else LD_RUN_PATH=$${LD_RUN_PATH}:$(libdir); fi; export LD_RUN_PATH;'
556 ;;
557 esac
558fi
559
560# On SunOS, if the linker supports the -rpath option, use it to
561# prevent ../bfd and ../opcodes from being included in the run time
562# search path.
563case "${host}" in
564 *-*-sunos*)
565 echo 'main () { }' > conftest.c
566 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
567 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
568 :
569 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
570 :
571 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
572 :
573 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
574 :
575 elif test "${shared}" = "true"; then
576 HLDFLAGS='-Wl,-rpath=$(libdir)'
577 else
578 HLDFLAGS='-Wl,-rpath='
579 fi
580 rm -f conftest.t conftest.c conftest
581 ;;
582esac
583AC_SUBST(HLDFLAGS)
584AC_SUBST(HLDENV)
585# End stuff to support --enable-shared
586
587# target_subdir is used by the testsuite to find the target libraries.
588target_subdir=
589if test "${host}" != "${target}"; then
590 target_subdir="${target_alias}/"
591fi
592AC_SUBST(target_subdir)
593
594frags=
595host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
596if test ! -f ${host_makefile_frag}; then
597AC_MSG_ERROR("*** Gdb does not support host ${host}")
598fi
599frags="$frags $host_makefile_frag"
600
601target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
602if test ! -f ${target_makefile_frag}; then
603AC_MSG_ERROR("*** Gdb does not support target ${target}")
604fi
605frags="$frags $target_makefile_frag"
606
607AC_SUBST_FILE(host_makefile_frag)
608AC_SUBST_FILE(target_makefile_frag)
609AC_SUBST(frags)
610
611changequote(,)dnl
612hostfile=`sed -n '
613s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
614' ${host_makefile_frag}`
615
616targetfile=`sed -n '
617s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
618' ${target_makefile_frag}`
619
620# these really aren't orthogonal true/false values of the same condition,
621# but shells are slow enough that I like to reuse the test conditions
622# whenever possible
623if test "${target}" = "${host}"; then
624nativefile=`sed -n '
625s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
626' ${host_makefile_frag}`
627# else
628# GDBserver is only useful in a "native" enviroment
629# configdirs=`echo $configdirs | sed 's/gdbserver//'`
630fi
631changequote([,])
632
96baa820
JM
633SUBDIRS="doc testsuite nlm"
634if test "${enable_multi_ice}" = "yes"; then
635 SUBDIRS="${SUBDIRS} multi-ice"
636fi
637
638AC_SUBST(SUBDIRS)
639
c906108c
SS
640# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
641# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
642# corresponding links. But we have to remove the xm.h files and tm.h
643# files anyway, e.g. when switching from "configure host" to
644# "configure none".
645
646files=
647links=
648rm -f xm.h
649if test "${hostfile}" != ""; then
650files="${files} config/${gdb_host_cpu}/${hostfile}"
651links="${links} xm.h"
652fi
653rm -f tm.h
654if test "${targetfile}" != ""; then
655files="${files} config/${gdb_target_cpu}/${targetfile}"
656links="${links} tm.h"
657fi
658rm -f nm.h
659if test "${nativefile}" != ""; then
660files="${files} config/${gdb_host_cpu}/${nativefile}"
661links="${links} nm.h"
662else
663# A cross-only configuration.
664files="${files} config/nm-empty.h"
665links="${links} nm.h"
666fi
667
668AC_LINK_FILES($files, $links)
669
670dnl Check for exe extension set on certain hosts (e.g. Win32)
671AC_EXEEXT
672
673AC_CONFIG_SUBDIRS($configdirs)
674AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
675[
676dnl Autoconf doesn't provide a mechanism for modifying definitions
677dnl provided by makefile fragments.
678dnl
679if test "${nativefile}" = ""; then
680sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
681 < Makefile > Makefile.tem
682mv -f Makefile.tem Makefile
683fi
684
685changequote(,)dnl
686sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
687/^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
688/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
689mv -f Makefile.tmp Makefile
690changequote([,])dnl
691
692case x$CONFIG_HEADERS in
693xconfig.h:config.in)
694echo > stamp-h ;;
695esac
696],
697[
698gdb_host_cpu=$gdb_host_cpu
699gdb_target_cpu=$gdb_target_cpu
700nativefile=$nativefile
701])
702
703exit 0
This page took 0.069018 seconds and 4 git commands to generate.