* gas/testsuite/all/gas.exp: No longer expect failures for
[deliverable/binutils-gdb.git] / gdb / configure.in
CommitLineData
2f4973f8
SG
1dnl Autoconf configure script for GDB, the GNU debugger.
2dnl Copyright 1995, 1996 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
476a283f 18dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
2f4973f8 19
5436fc65 20dnl Process this file with autoconf to produce a configure script.
2f4973f8 21
5d8b7982 22AC_PREREQ(2.5)dnl
5436fc65 23AC_INIT(main.c)
18ea4416 24AC_CONFIG_HEADER(config.h:config.in)
5436fc65 25
5436fc65
C
26AC_PROG_CC
27AC_AIX
28AC_MINIX
29AC_ISC_POSIX
30
35ce4f08
GN
31DLLTOOL=${DLLTOOL-dlltool}
32AC_SUBST(DLLTOOL)
33
f02156cf 34AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
0579b53d
GN
35AC_CANONICAL_SYSTEM
36
bfde4a67
SG
37dnl List of object files added by configure.
38
39CONFIG_OBS=
018d76dd 40CONFIG_DEPS=
c7bb1531 41CONFIG_SRCS=
bfde4a67
SG
42
43configdirs="doc testsuite"
44
45dnl
46changequote(,)dnl
47
48. ${srcdir}/configure.host
49
50. ${srcdir}/configure.tgt
51
52dnl
53changequote([,])dnl
54
5436fc65 55AC_PROG_INSTALL
d8efbc66
FF
56AC_CHECK_TOOL(AR, ar)
57AC_CHECK_TOOL(RANLIB, ranlib, :)
1e02f078 58AC_PROG_YACC
d8efbc66 59AC_PROG_AWK
5436fc65 60
5436fc65
C
61AC_ARG_PROGRAM
62
c14cabba
AC
63AC_TYPE_SIGNAL
64
2b576293 65AC_HEADER_STDC
0db3fe94 66AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h stdlib.h sys/procfs.h link.h endian.h objlist.h)
2b576293
C
67AC_HEADER_STAT
68
8501c742
SG
69AC_C_CONST
70
e7ab2a47 71AC_CHECK_FUNCS(setpgid sbrk select poll sigaction)
72ae15f6 72
54225fd0
MA
73# If we are configured native on Linux, work around problems with sys/procfs.h
74if test "${target}" = "${host}"; then
75 case "${host}" in
3435297a 76 i[[3456]]86-*-linux*)
0728afad 77 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
54225fd0
MA
78 AC_DEFINE(sys_quotactl)
79 ;;
80 esac
81fi
82
4708ac65 83AC_MSG_CHECKING([for gregset_t type])
07b77f5c 84AC_CACHE_VAL(gdb_cv_have_gregset_t,
4708ac65 85[AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
07b77f5c
FF
86gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
87AC_MSG_RESULT($gdb_cv_have_gregset_t)
88if test $gdb_cv_have_gregset_t = yes; then
4708ac65
FF
89 AC_DEFINE(HAVE_GREGSET_T)
90fi
91
92AC_MSG_CHECKING([for fpregset_t type])
07b77f5c 93AC_CACHE_VAL(gdb_cv_have_fpregset_t,
4708ac65 94[AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
07b77f5c
FF
95gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
96AC_MSG_RESULT($gdb_cv_have_fpregset_t)
97if test $gdb_cv_have_fpregset_t = yes; then
4708ac65
FF
98 AC_DEFINE(HAVE_FPREGSET_T)
99fi
100
ef6c51d1
SG
101dnl See if host has libm. This is usually needed by simulators.
102AC_CHECK_LIB(m, main)
103
3f550b59
FF
104dnl See if compiler supports "long long" type.
105
106AC_MSG_CHECKING(for long long support in compiler)
107AC_CACHE_VAL(gdb_cv_c_long_long,
80f600a4 108[AC_TRY_COMPILE(, [
d538f9cf
FF
109 extern long long foo;
110 switch (foo & 2) { case 0: return 1; }
111],
3f550b59
FF
112gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
113AC_MSG_RESULT($gdb_cv_c_long_long)
114if test $gdb_cv_c_long_long = yes; then
115 AC_DEFINE(CC_HAS_LONG_LONG)
116fi
117
118dnl See if the compiler and runtime support printing long long
119
120AC_MSG_CHECKING(for long long support in printf)
121AC_CACHE_VAL(gdb_cv_printf_has_long_long,
122[AC_TRY_RUN([
123int main () {
f7b8c9ce
AC
124 char buf[32];
125 long long l = 0;
126 l = (l << 16) + 0x0123;
127 l = (l << 16) + 0x4567;
128 l = (l << 16) + 0x89ab;
129 l = (l << 16) + 0xcdef;
130 sprintf (buf, "0x%016llx", l);
131 return (strcmp ("0x0123456789abcdef", buf));
3f550b59
FF
132}],
133gdb_cv_printf_has_long_long=yes,
134gdb_cv_printf_has_long_long=no,
135gdb_cv_printf_has_long_long=no)])
136if test $gdb_cv_printf_has_long_long = yes; then
137 AC_DEFINE(PRINTF_HAS_LONG_LONG)
138fi
139AC_MSG_RESULT($gdb_cv_printf_has_long_long)
140
aa220473
SG
141dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
142dnl because autoconf complains about cross-compilation issues. However, this
143dnl code uses the same variables as the macro for compatibility.
144
07b77f5c 145AC_MSG_CHECKING(for long double support in compiler)
aa220473
SG
146AC_CACHE_VAL(ac_cv_c_long_double,
147[AC_TRY_COMPILE(, [long double foo;],
148ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
149AC_MSG_RESULT($ac_cv_c_long_double)
150if test $ac_cv_c_long_double = yes; then
151 AC_DEFINE(HAVE_LONG_DOUBLE)
152fi
153
07b77f5c
FF
154dnl See if the compiler and runtime support printing long doubles
155
156AC_MSG_CHECKING(for long double support in printf)
157AC_CACHE_VAL(gdb_cv_printf_has_long_double,
158[AC_TRY_RUN([
159int main () {
160 char buf[16];
161 long double f = 3.141592653;
162 sprintf (buf, "%Lg", f);
163 return (strncmp ("3.14159", buf, 7));
164}],
165gdb_cv_printf_has_long_double=yes,
166gdb_cv_printf_has_long_double=no,
167gdb_cv_printf_has_long_double=no)])
168if test $gdb_cv_printf_has_long_double = yes; then
169 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
170fi
171AC_MSG_RESULT($gdb_cv_printf_has_long_double)
172
f7b8c9ce
AC
173dnl See if the compiler and runtime support scanning long doubles
174
175AC_MSG_CHECKING(for long double support in scanf)
176AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
177[AC_TRY_RUN([
178int main () {
179 char *buf = "3.141592653";
180 long double f = 0;
181 sscanf (buf, "%Lg", &f);
182 return !(f > 3.14159 && f < 3.14160);
183}],
184gdb_cv_scanf_has_long_double=yes,
185gdb_cv_scanf_has_long_double=no,
186gdb_cv_scanf_has_long_double=no)])
187if test $gdb_cv_scanf_has_long_double = yes; then
188 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
189fi
190AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
191
2b576293 192AC_FUNC_MMAP
5436fc65 193
fef1696f
ILT
194BFD_NEED_DECLARATION(malloc)
195BFD_NEED_DECLARATION(realloc)
196BFD_NEED_DECLARATION(free)
197
4915acad
SG
198dnl See if thread_db library is around for Solaris thread debugging. Note that
199dnl we must explicitly test for version 1 of the library because version 0
200dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
201
89e673a4
SG
202dnl Note that we only want this if we are both native (host == target), and
203dnl not doing a canadian cross build (build == host).
204
205if test ${build} = ${host} -a ${host} = ${target} ; then
4b95e9a1
JM
206 case ${host_os} in
207 hpux*)
208 AC_MSG_CHECKING(for HPUX/OSF thread support)
209 if test -f /usr/include/dce/cma_config.h ; then
210 if test "$GCC" = "yes" ; then
211 AC_MSG_RESULT(yes)
212 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
213 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
c7bb1531 214 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
4b95e9a1
JM
215 else
216 AC_MSG_RESULT(no (suppressed because you are not using GCC))
217 fi
218 else
219 AC_MSG_RESULT(no)
220 fi
221 ;;
222 solaris*)
223 AC_MSG_CHECKING(for Solaris thread debugging library)
224 if test -f /usr/lib/libthread_db.so.1 ; then
225 AC_MSG_RESULT(yes)
226 AC_DEFINE(HAVE_THREAD_DB_LIB)
227 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
c7bb1531 228 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
4b95e9a1
JM
229 AC_CHECK_LIB(dl, dlopen)
230 if test "$GCC" = "yes" ; then
231 # The GNU linker requires the -export-dynamic option to make
232 # all symbols visible in the dynamic symbol table.
233 hold_ldflags=$LDFLAGS
234 AC_MSG_CHECKING(for the ld -export-dynamic flag)
235 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
236 AC_TRY_LINK(, [int i;], found=yes, found=no)
237 LDFLAGS=$hold_ldflags
238 AC_MSG_RESULT($found)
239 if test $found = yes; then
240 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
241 fi
242 fi
243 else
244 AC_MSG_RESULT(no)
245 fi
246 ;;
247 esac
248 AC_SUBST(CONFIG_LDFLAGS)
89e673a4 249fi
47ef0da5 250
5436fc65
C
251dnl Handle optional features that can be enabled.
252ENABLE_CFLAGS=
5436fc65
C
253
254AC_ARG_ENABLE(netrom,
255[ --enable-netrom ],
256[case "${enableval}" in
257yes) enable_netrom=yes ;;
258no) enable_netrom=no ;;
259*) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
260esac])
261
262if test "${enable_netrom}" = "yes"; then
6c310da8 263 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
c7bb1531 264 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
5436fc65
C
265fi
266
0728afad
FF
267MMALLOC_CFLAGS=
268MMALLOC=
269AC_SUBST(MMALLOC_CFLAGS)
270AC_SUBST(MMALLOC)
271
272AC_ARG_WITH(mmalloc,
273[ --with-mmalloc use memory mapped malloc package],
274[case "${withval}" in
275 yes) want_mmalloc=true ;;
276 no) want_mmalloc=false;;
277 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
278esac],[want_mmalloc=false])dnl
279
280if test x$want_mmalloc = xtrue; then
281 AC_DEFINE(USE_MMALLOC)
dd600735 282 AC_DEFINE(MMCHECK_FORCE)
0728afad
FF
283 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
284 MMALLOC='../mmalloc/libmmalloc.a'
285fi
286
5436fc65 287# start-sanitize-gdbtk
2476848a
MH
288ENABLE_IDE=
289AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support])
290if test "$enable_ide" = yes; then
291 enable_ide=yes
292 ENABLE_IDE=1
293else
294 enable_ide=no
295fi
296AC_SUBST(ENABLE_IDE)
297
5436fc65
C
298ENABLE_GDBTK=
299
300AC_ARG_ENABLE(gdbtk,
301[ --enable-gdbtk ],
302[case "${enableval}" in
0fe1522a
SG
303 yes)
304 case "$host" in
305 *go32*)
306 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
307 enable_gdbtk=no ;;
8a19b35a 308 *windows*)
b613bfbf
GN
309 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
310 enable_gdbtk=no ;;
0fe1522a
SG
311 *)
312 enable_gdbtk=yes ;;
313 esac ;;
314 no)
315 enable_gdbtk=no ;;
316 *)
317 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
318esac],
319[
b613bfbf 320# Default is on for everything but go32 and cygwin32
0fe1522a 321case "$host" in
8a19b35a 322 *go32* | *windows*)
b613bfbf 323 ;;
0fe1522a
SG
324 *)
325 enable_gdbtk=yes ;;
326 esac
327])
5436fc65 328
9b119644
ILT
329# In the cygwin32 environment, we need some additional flags.
330AC_CACHE_CHECK([for cygwin32], gdb_cv_os_cygwin32,
331[AC_EGREP_CPP(lose, [
332#ifdef __CYGWIN32__
333lose
334#endif],[gdb_cv_os_cygwin32=yes],[gdb_cv_os_cygwin32=no])])
335
336WIN32LIBS=
337WIN32LDAPP=
338AC_SUBST(WIN32LIBS)
339AC_SUBST(WIN32LDAPP)
340
929db6e5
EZ
341WINDRES=${WINDRES-windres}
342AC_SUBST(WINDRES)
343
9b119644
ILT
344if test x$gdb_cv_os_cygwin32 = xyes; then
345 if test x$enable_ide = xyes; then
346 WIN32LIBS="-ladvapi32"
347 fi
348fi
349
350configdir="unix"
8a19b35a 351
5436fc65 352if test "${enable_gdbtk}" = "yes"; then
0fe1522a 353
047465fd 354 CY_AC_PATH_TCLCONFIG
0cf433d9
ILT
355 if test -z "${no_tcl}"; then
356 CY_AC_LOAD_TCLCONFIG
357 CY_AC_PATH_TKCONFIG
047465fd 358
0cf433d9
ILT
359 # If $no_tk is nonempty, then we can't do Tk, and there is no
360 # point to doing Tcl.
361 if test -z "${no_tk}"; then
362 CY_AC_LOAD_TKCONFIG
363 CY_AC_PATH_TCLH
364 CY_AC_PATH_TKH
2476848a
MH
365 CY_AC_PATH_ITCLH
366 CY_AC_PATH_TIX
047465fd 367
6bc5b2fa 368 # now look for tix library stuff
1154b47a 369 TIXVERSION=4.1.8.0
6bc5b2fa
MH
370 . ${ac_cv_c_tclconfig}/tclConfig.sh
371 case "${host}" in
372 *-*-cygwin32*)
f1f6dd9c 373 tixdir=../tix/win/tcl8.0
6bc5b2fa
MH
374 ;;
375 *)
1154b47a 376 tixdir=../tix/unix/tk8.0
6bc5b2fa
MH
377 ;;
378 esac
bb3d9f43
KS
379 if test "${TCL_SHARED_BUILD}" = "1"; then
380 TIX_LIB_EXT="${TCL_SHLIB_SUFFIX}"
11f91b2b
KS
381
382 # Can't win them all: SunOS 4 (others?) appends a version
383 # number after the ".so"
384 case "${host}" in
385 *-*-sunos4*)
386 TIX_LIB_EXT="${TIX_LIB_EXT}.1.0" ;;
387 esac
388
bb3d9f43
KS
389 else
390 TIX_LIB_EXT=".a"
391 fi
11f91b2b 392
6bc5b2fa
MH
393 if test "${TCL_LIB_VERSIONS_OK}" = "ok"; then
394 TIXLIB="-L${tixdir} -ltix${TIXVERSION}"
bb3d9f43 395 TIX_DEPS="${tixdir}/libtix${TIXVERSION}${TIX_LIB_EXT}"
6bc5b2fa
MH
396 else
397 TIXLIB="-L${tixdir} -ltix`echo ${TIXVERSION} | tr -d .`"
bb3d9f43 398 TIX_DEPS="${tixdir}/libtix`echo ${TIXVERSION} | tr -d .`${TIX_LIB_EXT}"
6bc5b2fa
MH
399 fi
400
0cf433d9 401 ENABLE_GDBTK=1
1a57cd09 402
6c310da8 403 # Include some libraries that Tcl and Tk want.
2476848a 404 if test "${enable_ide}" = "yes"; then
8b5befef
ILT
405 TCL_LIBS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
406 CONFIG_DEPS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE_DEPS) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
2476848a 407 else
dafec9dd
ILT
408 TCL_LIBS='$(LIBGUI) $(ITCL) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
409 CONFIG_DEPS='$(LIBGUI) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
2476848a 410 fi
46964086
TT
411 # Yes, the ordering seems wrong here. But it isn't.
412 # TK_LIBS is the list of libraries that need to be linked
413 # after Tcl/Tk.
414 LIBS="${LIBS} ${TCL_LIBS} ${TK_LIBS}"
dd3dd918 415 CONFIG_OBS="${CONFIG_OBS} gdbtk.o"
9b119644
ILT
416
417 if test x$gdb_cv_os_cygwin32 = xyes; then
018d76dd 418 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32 -luser32"
9b119644 419 WIN32LDAPP="-Wl,--subsystem,windows"
929db6e5 420 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
9b119644 421 fi
0cf433d9 422 fi
a2b63bbd 423 fi
5436fc65 424fi
a2b63bbd 425
5436fc65 426AC_SUBST(ENABLE_GDBTK)
9c0bc1da 427AC_SUBST(X_CFLAGS)
a2b63bbd
JM
428AC_SUBST(X_LDFLAGS)
429AC_SUBST(X_LIBS)
6bc5b2fa 430AC_SUBST(TIXLIB)
018d76dd 431AC_SUBST(TIX_DEPS)
5436fc65
C
432# end-sanitize-gdbtk
433
b236defa
FCE
434AC_PATH_X
435# start-sanitize-sky
436# Enable GPU2 library for MIPS simulator
437AC_ARG_WITH(sim-gpu2,
438[ --with-sim-gpu2=path Use GPU2 library under given directory],
bd5eafcd
FCE
439[case "${target}" in
440 mips*-sky-*)
441 if test -d "${withval}"
442 then
443 LIBS="${LIBS} -L${withval}/lib -lgpu2 -L${x_libraries} -lX11"
444 else
445 AC_MSG_WARN([Directory ${withval} does not exist.])
446 fi ;;
447 *) AC_MSG_WARN([--with-sim-gpu2 option invalid for target ${target}])
448esac])dnl
b236defa
FCE
449# end-sanitize-sky
450
5436fc65 451AC_SUBST(ENABLE_CFLAGS)
6c310da8
SG
452
453AC_SUBST(CONFIG_OBS)
018d76dd 454AC_SUBST(CONFIG_DEPS)
c7bb1531 455AC_SUBST(CONFIG_SRCS)
6ec7e4d3 456
1d5eb137
FF
457# Begin stuff to support --enable-shared
458AC_ARG_ENABLE(shared,
459[ --enable-shared use shared libraries],
460[case "${enableval}" in
461 yes) shared=true ;;
462 no) shared=false ;;
463 *) shared=true ;;
464esac])dnl
465
466HLDFLAGS=
467HLDENV=
468# If we have shared libraries, try to set rpath reasonably.
469if test "${shared}" = "true"; then
470 case "${host}" in
471 *-*-hpux*)
472 HLDFLAGS='-Wl,+s,+b,$(libdir)'
473 ;;
474 *-*-irix5* | *-*-irix6*)
475 HLDFLAGS='-Wl,-rpath,$(libdir)'
476 ;;
477 *-*-linux*aout*)
478 ;;
8ddf07a2 479 *-*-linux* | *-pc-linux-gnu)
1d5eb137
FF
480 HLDFLAGS='-Wl,-rpath,$(libdir)'
481 ;;
482 *-*-solaris*)
483 HLDFLAGS='-R $(libdir)'
484 ;;
485 *-*-sysv4*)
486 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;'
487 ;;
488 esac
489fi
490
491# On SunOS, if the linker supports the -rpath option, use it to
492# prevent ../bfd and ../opcodes from being included in the run time
493# search path.
494case "${host}" in
495 *-*-sunos*)
496 echo 'main () { }' > conftest.c
497 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
498 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
499 :
500 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
501 :
502 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
503 :
074d813d
PS
504 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
505 :
1d5eb137
FF
506 elif test "${shared}" = "true"; then
507 HLDFLAGS='-Wl,-rpath=$(libdir)'
508 else
509 HLDFLAGS='-Wl,-rpath='
510 fi
511 rm -f conftest.t conftest.c conftest
512 ;;
513esac
514AC_SUBST(HLDFLAGS)
515AC_SUBST(HLDENV)
516# End stuff to support --enable-shared
517
9c0bc1da
DE
518# target_subdir is used by the testsuite to find the target libraries.
519target_subdir=
520if test "${host}" != "${target}"; then
521 target_subdir="${target_alias}/"
522fi
523AC_SUBST(target_subdir)
bc028766 524
5f107900 525frags=
5436fc65
C
526host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
527if test ! -f ${host_makefile_frag}; then
528AC_MSG_ERROR("*** Gdb does not support host ${host}")
912e0732 529fi
5f107900 530frags="$frags $host_makefile_frag"
912e0732 531
5436fc65
C
532target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
533if test ! -f ${target_makefile_frag}; then
534AC_MSG_ERROR("*** Gdb does not support target ${target}")
912e0732 535fi
5f107900 536frags="$frags $target_makefile_frag"
912e0732 537
5436fc65
C
538AC_SUBST_FILE(host_makefile_frag)
539AC_SUBST_FILE(target_makefile_frag)
5f107900 540AC_SUBST(frags)
5436fc65 541
094fd4ae
C
542changequote(,)dnl
543hostfile=`sed -n '
544s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
545' ${host_makefile_frag}`
5436fc65 546
094fd4ae
C
547targetfile=`sed -n '
548s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
549' ${target_makefile_frag}`
79f68f0f
DZ
550
551# these really aren't orthogonal true/false values of the same condition,
552# but shells are slow enough that I like to reuse the test conditions
553# whenever possible
5436fc65 554if test "${target}" = "${host}"; then
094fd4ae
C
555nativefile=`sed -n '
556s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
557' ${host_makefile_frag}`
33ef0f93 558# else
5436fc65 559# GDBserver is only useful in a "native" enviroment
33ef0f93 560# configdirs=`echo $configdirs | sed 's/gdbserver//'`
d40309c7 561fi
094fd4ae 562changequote([,])
d40309c7 563
d40309c7 564# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
6573c898 565# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
d40309c7
JG
566# corresponding links. But we have to remove the xm.h files and tm.h
567# files anyway, e.g. when switching from "configure host" to
568# "configure none".
569
bdf3621b
JG
570files=
571links=
dc0c3f64 572rm -f xm.h
5436fc65
C
573if test "${hostfile}" != ""; then
574files="${files} config/${gdb_host_cpu}/${hostfile}"
575links="${links} xm.h"
bdf3621b 576fi
dc0c3f64 577rm -f tm.h
5436fc65
C
578if test "${targetfile}" != ""; then
579files="${files} config/${gdb_target_cpu}/${targetfile}"
580links="${links} tm.h"
bdf3621b 581fi
1a0edbc7 582rm -f nm.h
5436fc65
C
583if test "${nativefile}" != ""; then
584files="${files} config/${gdb_host_cpu}/${nativefile}"
585links="${links} nm.h"
c9c23412 586else
5436fc65
C
587# A cross-only configuration.
588files="${files} config/nm-empty.h"
589links="${links} nm.h"
d40309c7 590fi
d3d75ec9 591# start-sanitize-gdbtk
99174711 592AC_PROG_LN_S
5436fc65 593# Make it possible to use the GUI without doing a full install
99174711
JM
594if test "${enable_gdbtk}" = "yes" -a ! -d gdbtcl ; then
595 if test "$LN_S" = "ln -s" -a ! -f gdbtcl ; then
596 echo linking $srcdir/gdbtcl to gdbtcl
597 $LN_S $srcdir/gdbtcl gdbtcl
598 else
599 echo Warning: Unable to link $srcdir/gdbtcl to gdbtcl. You will need to do a
600 echo " " make install before you are able to run the GUI.
601 fi
754e5da2 602fi
d3d75ec9 603# end-sanitize-gdbtk
754e5da2 604
5436fc65
C
605AC_LINK_FILES($files, $links)
606
98fa4ade
GN
607dnl Check for exe extension set on certain hosts (e.g. Win32)
608AM_EXEEXT
609
5436fc65 610AC_CONFIG_SUBDIRS($configdirs)
0cb7d01d 611AC_OUTPUT(Makefile .gdbinit:gdbinit.in,
5436fc65
C
612[
613dnl Autoconf doesn't provide a mechanism for modifying definitions
614dnl provided by makefile fragments.
615dnl
616if test "${nativefile}" = ""; then
7bd1f0c5 617sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
5436fc65
C
618 < Makefile > Makefile.tem
619mv -f Makefile.tem Makefile
33bc979d
SS
620fi
621
5436fc65 622changequote(,)dnl
94d4b713
JK
623sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
624/^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
625/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
626mv -f Makefile.tmp Makefile
5436fc65
C
627changequote([,])dnl
628
31520669 629case x$CONFIG_HEADERS in
18ea4416 630xconfig.h:config.in)
31520669
FF
631echo > stamp-h ;;
632esac
0a5a1821
C
633],
634[
635gdb_host_cpu=$gdb_host_cpu
636gdb_target_cpu=$gdb_target_cpu
637nativefile=$nativefile
5436fc65 638])
5e711e7f
PS
639
640exit 0
b7f3b6d5 641
This page took 0.326129 seconds and 4 git commands to generate.