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