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