Declare Gould configuration obsolete:
[deliverable/binutils-gdb.git] / gdb / configure.in
CommitLineData
2f4973f8 1dnl Autoconf configure script for GDB, the GNU debugger.
f240337a 2dnl Copyright 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
2f4973f8
SG
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
0abbe35d 22AC_PREREQ(2.13)dnl
5436fc65 23AC_INIT(main.c)
18ea4416 24AC_CONFIG_HEADER(config.h:config.in)
5436fc65 25
5436fc65
C
26AC_PROG_CC
27AC_AIX
5436fc65 28AC_ISC_POSIX
460845ab 29AM_PROG_CC_STDC
5436fc65 30
f02156cf 31AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..)
0579b53d
GN
32AC_CANONICAL_SYSTEM
33
fcfc3c0c
TT
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
bfde4a67
SG
39dnl List of object files added by configure.
40
41CONFIG_OBS=
018d76dd 42CONFIG_DEPS=
c7bb1531 43CONFIG_SRCS=
bfde4a67
SG
44
45configdirs="doc testsuite"
46
47dnl
48changequote(,)dnl
49
50. ${srcdir}/configure.host
51
52. ${srcdir}/configure.tgt
53
54dnl
55changequote([,])dnl
56
5436fc65 57AC_PROG_INSTALL
d8efbc66
FF
58AC_CHECK_TOOL(AR, ar)
59AC_CHECK_TOOL(RANLIB, ranlib, :)
1e02f078 60AC_PROG_YACC
5436fc65 61
5436fc65
C
62AC_ARG_PROGRAM
63
c14cabba
AC
64AC_TYPE_SIGNAL
65
2b576293 66AC_HEADER_STDC
9ed669cf 67
8aad4bd6 68AC_CHECK_HEADERS(ctype.h curses.h endian.h link.h \
c98fe0c1
JI
69 memory.h objlist.h ptrace.h sgtty.h stddef.h stdlib.h \
70 string.h sys/procfs.h sys/ptrace.h sys/reg.h \
71 term.h termio.h termios.h unistd.h wait.h sys/wait.h \
72 wchar.h wctype.h asm/debugreg.h)
2b576293
C
73AC_HEADER_STAT
74
8501c742
SG
75AC_C_CONST
76
b0f33a03 77AC_CHECK_FUNCS(setpgid sbrk sigaction isascii bzero bcopy btowc)
0aa3233e 78AC_FUNC_ALLOCA
72ae15f6 79
87feff9d
JM
80BFD_NEED_DECLARATION(malloc)
81BFD_NEED_DECLARATION(realloc)
82BFD_NEED_DECLARATION(free)
83BFD_NEED_DECLARATION(strerror)
84BFD_NEED_DECLARATION(strdup)
85
e3147bf2 86# If we are configured native on GNU/Linux, work around problems with sys/procfs.h
54225fd0
MA
87if test "${target}" = "${host}"; then
88 case "${host}" in
3435297a 89 i[[3456]]86-*-linux*)
0728afad 90 AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,2)
54225fd0
MA
91 AC_DEFINE(sys_quotactl)
92 ;;
93 esac
94fi
95
4708ac65 96AC_MSG_CHECKING([for gregset_t type])
07b77f5c 97AC_CACHE_VAL(gdb_cv_have_gregset_t,
4708ac65 98[AC_TRY_LINK([#include <sys/procfs.h>],[gregset_t *gregsetp = 0],
07b77f5c
FF
99gdb_cv_have_gregset_t=yes, gdb_cv_have_gregset_t=no)])
100AC_MSG_RESULT($gdb_cv_have_gregset_t)
101if test $gdb_cv_have_gregset_t = yes; then
4708ac65
FF
102 AC_DEFINE(HAVE_GREGSET_T)
103fi
104
105AC_MSG_CHECKING([for fpregset_t type])
07b77f5c 106AC_CACHE_VAL(gdb_cv_have_fpregset_t,
4708ac65 107[AC_TRY_LINK([#include <sys/procfs.h>],[fpregset_t *fpregsetp = 0],
07b77f5c
FF
108gdb_cv_have_fpregset_t=yes, gdb_cv_have_fpregset_t=no)])
109AC_MSG_RESULT($gdb_cv_have_fpregset_t)
110if test $gdb_cv_have_fpregset_t = yes; then
4708ac65
FF
111 AC_DEFINE(HAVE_FPREGSET_T)
112fi
113
ef6c51d1
SG
114dnl See if host has libm. This is usually needed by simulators.
115AC_CHECK_LIB(m, main)
116
879c0417
JM
117dnl Solaris puts wctype in /usr/lib/libw.a before Solaris 2.6.
118dnl
119dnl A bug in GNU ld 2.9.1 causes a problem if we link in -lw
120dnl under Solaris 2.6 because it is some funky empty library.
121dnl So only link in libw if we have to.
122AC_CHECK_LIB(c, wctype,: ,AC_CHECK_LIB(w, wctype))
123
adcb1e06
JM
124AC_SUBST(TERM_LIB)
125
3f550b59
FF
126dnl See if compiler supports "long long" type.
127
128AC_MSG_CHECKING(for long long support in compiler)
129AC_CACHE_VAL(gdb_cv_c_long_long,
80f600a4 130[AC_TRY_COMPILE(, [
d538f9cf
FF
131 extern long long foo;
132 switch (foo & 2) { case 0: return 1; }
133],
3f550b59
FF
134gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)])
135AC_MSG_RESULT($gdb_cv_c_long_long)
136if test $gdb_cv_c_long_long = yes; then
137 AC_DEFINE(CC_HAS_LONG_LONG)
138fi
139
140dnl See if the compiler and runtime support printing long long
141
142AC_MSG_CHECKING(for long long support in printf)
143AC_CACHE_VAL(gdb_cv_printf_has_long_long,
144[AC_TRY_RUN([
145int main () {
f7b8c9ce
AC
146 char buf[32];
147 long long l = 0;
148 l = (l << 16) + 0x0123;
149 l = (l << 16) + 0x4567;
150 l = (l << 16) + 0x89ab;
151 l = (l << 16) + 0xcdef;
152 sprintf (buf, "0x%016llx", l);
153 return (strcmp ("0x0123456789abcdef", buf));
3f550b59
FF
154}],
155gdb_cv_printf_has_long_long=yes,
156gdb_cv_printf_has_long_long=no,
157gdb_cv_printf_has_long_long=no)])
158if test $gdb_cv_printf_has_long_long = yes; then
159 AC_DEFINE(PRINTF_HAS_LONG_LONG)
160fi
161AC_MSG_RESULT($gdb_cv_printf_has_long_long)
162
aa220473
SG
163dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE
164dnl because autoconf complains about cross-compilation issues. However, this
165dnl code uses the same variables as the macro for compatibility.
166
07b77f5c 167AC_MSG_CHECKING(for long double support in compiler)
aa220473
SG
168AC_CACHE_VAL(ac_cv_c_long_double,
169[AC_TRY_COMPILE(, [long double foo;],
170ac_cv_c_long_double=yes, ac_cv_c_long_double=no)])
171AC_MSG_RESULT($ac_cv_c_long_double)
172if test $ac_cv_c_long_double = yes; then
173 AC_DEFINE(HAVE_LONG_DOUBLE)
174fi
175
07b77f5c
FF
176dnl See if the compiler and runtime support printing long doubles
177
178AC_MSG_CHECKING(for long double support in printf)
179AC_CACHE_VAL(gdb_cv_printf_has_long_double,
180[AC_TRY_RUN([
181int main () {
182 char buf[16];
183 long double f = 3.141592653;
184 sprintf (buf, "%Lg", f);
185 return (strncmp ("3.14159", buf, 7));
186}],
187gdb_cv_printf_has_long_double=yes,
188gdb_cv_printf_has_long_double=no,
189gdb_cv_printf_has_long_double=no)])
190if test $gdb_cv_printf_has_long_double = yes; then
191 AC_DEFINE(PRINTF_HAS_LONG_DOUBLE)
192fi
193AC_MSG_RESULT($gdb_cv_printf_has_long_double)
194
f7b8c9ce
AC
195dnl See if the compiler and runtime support scanning long doubles
196
197AC_MSG_CHECKING(for long double support in scanf)
198AC_CACHE_VAL(gdb_cv_scanf_has_long_double,
199[AC_TRY_RUN([
200int main () {
201 char *buf = "3.141592653";
202 long double f = 0;
203 sscanf (buf, "%Lg", &f);
204 return !(f > 3.14159 && f < 3.14160);
205}],
206gdb_cv_scanf_has_long_double=yes,
207gdb_cv_scanf_has_long_double=no,
208gdb_cv_scanf_has_long_double=no)])
209if test $gdb_cv_scanf_has_long_double = yes; then
210 AC_DEFINE(SCANF_HAS_LONG_DOUBLE)
211fi
212AC_MSG_RESULT($gdb_cv_scanf_has_long_double)
213
2b576293 214AC_FUNC_MMAP
5436fc65 215
4915acad
SG
216dnl See if thread_db library is around for Solaris thread debugging. Note that
217dnl we must explicitly test for version 1 of the library because version 0
218dnl (present on Solaris 2.4 or earlier) doesn't have the same API.
219
89e673a4
SG
220dnl Note that we only want this if we are both native (host == target), and
221dnl not doing a canadian cross build (build == host).
222
223if test ${build} = ${host} -a ${host} = ${target} ; then
4b95e9a1
JM
224 case ${host_os} in
225 hpux*)
226 AC_MSG_CHECKING(for HPUX/OSF thread support)
227 if test -f /usr/include/dce/cma_config.h ; then
228 if test "$GCC" = "yes" ; then
229 AC_MSG_RESULT(yes)
230 AC_DEFINE(HAVE_HPUX_THREAD_SUPPORT)
231 CONFIG_OBS="${CONFIG_OJS} hpux-thread.o"
c7bb1531 232 CONFIG_SRCS="${CONFIG_SRCS} hpux-thread.c"
4b95e9a1
JM
233 else
234 AC_MSG_RESULT(no (suppressed because you are not using GCC))
235 fi
236 else
237 AC_MSG_RESULT(no)
238 fi
239 ;;
240 solaris*)
241 AC_MSG_CHECKING(for Solaris thread debugging library)
242 if test -f /usr/lib/libthread_db.so.1 ; then
243 AC_MSG_RESULT(yes)
244 AC_DEFINE(HAVE_THREAD_DB_LIB)
245 CONFIG_OBS="${CONFIG_OBS} sol-thread.o"
c7bb1531 246 CONFIG_SRCS="${CONFIG_SRCS} sol-thread.c"
4b95e9a1
JM
247 AC_CHECK_LIB(dl, dlopen)
248 if test "$GCC" = "yes" ; then
249 # The GNU linker requires the -export-dynamic option to make
250 # all symbols visible in the dynamic symbol table.
251 hold_ldflags=$LDFLAGS
252 AC_MSG_CHECKING(for the ld -export-dynamic flag)
253 LDFLAGS="${LDFLAGS} -Wl,-export-dynamic"
254 AC_TRY_LINK(, [int i;], found=yes, found=no)
255 LDFLAGS=$hold_ldflags
256 AC_MSG_RESULT($found)
257 if test $found = yes; then
258 CONFIG_LDFLAGS="${CONFIG_LDFLAGS} -Wl,-export-dynamic"
259 fi
260 fi
37f58dce
FL
261 # Sun randomly tweaked the prototypes in <proc_service.h>
262 # at one point.
263 AC_MSG_CHECKING(if <proc_service.h> is old)
264 AC_CACHE_VAL(gdb_cv_proc_service_is_old,[
265 AC_TRY_COMPILE([
266 #include <proc_service.h>
267 ps_err_e ps_pdwrite
268 (struct ps_prochandle*, psaddr_t, const void*, size_t);
269 ],, gdb_cv_proc_service_is_old=no,
270 gdb_cv_proc_service_is_old=yes)
271 ])
272 AC_MSG_RESULT($gdb_cv_proc_service_is_old)
273 if test $gdb_cv_proc_service_is_old = yes; then
274 AC_DEFINE(PROC_SERVICE_IS_OLD)
275 fi
4b95e9a1
JM
276 else
277 AC_MSG_RESULT(no)
278 fi
279 ;;
280 esac
281 AC_SUBST(CONFIG_LDFLAGS)
89e673a4 282fi
47ef0da5 283
5436fc65
C
284dnl Handle optional features that can be enabled.
285ENABLE_CFLAGS=
5436fc65 286
460845ab
DT
287AC_ARG_ENABLE(tui,
288[ --enable-tui Enable full-screen terminal user interface],
289[
290 case "${enable_tui}" in
291 yes | no) ;;
292 "") enable_tui=yes ;;
293 *)
294 AC_MSG_ERROR(Bad value for --enable-tui: ${enableval})
295 ;;
296 esac
297])
298case ${enable_tui} in
299 "yes" )
300 AC_DEFINE(TUI)
301 BUILD_TUI=all-tui
302 TUI_LIBRARY=tui/libtui.a
303 ;;
304 * )
305 BUILD_TUI=
306 TUI_LIBRARY=
307 ;;
308esac
309AC_SUBST(BUILD_TUI)
310AC_SUBST(TUI_LIBRARY)
311
5436fc65 312AC_ARG_ENABLE(netrom,
d951f9e4 313[ --enable-netrom Enable NetROM support],
5436fc65
C
314[case "${enableval}" in
315yes) enable_netrom=yes ;;
316no) enable_netrom=no ;;
317*) AC_MSG_ERROR(bad value ${enableval} given for netrom option) ;;
318esac])
319
320if test "${enable_netrom}" = "yes"; then
6c310da8 321 CONFIG_OBS="${CONFIG_OBS} remote-nrom.o"
c7bb1531 322 CONFIG_SRCS="${CONFIG_SRCS} remote-nrom.c"
5436fc65
C
323fi
324
b9a9cde4 325AC_ARG_ENABLE(build-warnings,
d951f9e4 326[ --enable-build-warnings Enable build-time compiler warnings if gcc is used],
b9a9cde4
AC
327[build_warnings="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations"
328case "${enableval}" in
329 yes) ;;
330 no) build_warnings="-w";;
c8623080
AC
331 ,*) t=`echo "${enableval}" | sed -e "s/,/ /g"`
332 build_warnings="${build_warnings} ${t}";;
333 *,) t=`echo "${enableval}" | sed -e "s/,/ /g"`
334 build_warnings="${t} ${build_warnings}";;
335 *) build_warnings=`echo "${enableval}" | sed -e "s/,/ /g"`;;
b9a9cde4
AC
336esac],[build_warnings=""])dnl
337
338if test "x${build_warnings}" != x -a "x$GCC" = xyes
ba68ad57 339then
b9a9cde4 340 WARN_CFLAGS="${build_warnings}"
ba68ad57
JM
341else
342 WARN_CFLAGS=""
343fi
344AC_SUBST(WARN_CFLAGS)
345
0728afad
FF
346MMALLOC_CFLAGS=
347MMALLOC=
348AC_SUBST(MMALLOC_CFLAGS)
349AC_SUBST(MMALLOC)
350
351AC_ARG_WITH(mmalloc,
ba68ad57 352[ --with-mmalloc Use memory mapped malloc package],
0728afad
FF
353[case "${withval}" in
354 yes) want_mmalloc=true ;;
355 no) want_mmalloc=false;;
356 *) AC_MSG_ERROR(bad value ${withval} for GDB with-mmalloc option) ;;
357esac],[want_mmalloc=false])dnl
358
359if test x$want_mmalloc = xtrue; then
360 AC_DEFINE(USE_MMALLOC)
dd600735 361 AC_DEFINE(MMCHECK_FORCE)
0728afad
FF
362 MMALLOC_CFLAGS="-I$srcdir/../mmalloc"
363 MMALLOC='../mmalloc/libmmalloc.a'
364fi
365
287026b7
AC
366# start-sanitize-carp
367# The below takes an educated guess at the targets that
368# should be built. It is an interum version that provides
369# significant backward compatibility.
370
371AC_ARG_ENABLE(carp,
d951f9e4 372[ --enable-carp Configure alternative readaptive paradigm ],
287026b7
AC
373[case "${enableval}" in
374 yes) enable_carp=yes ;;
375 no) enable_carp=no ;;
376 *) AC_MSG_ERROR([bad value ${enableval} for carp option]) ;;
377esac],[enable_carp=no])dnl
378
379AC_ARG_ENABLE(targets,
380[ --enable-targets alternative target configurations],
381[case "${enableval}" in
382 yes | "") AC_ERROR(enable-targets option must specify target names or 'all')
383 ;;
384 no) enable_targets= ;;
385 *) enable_targets="$enableval" ;;
386esac])dnl
387
388# Canonicalize the secondary target names.
389all_targets=false
390if test -n "$enable_targets" ; then
391 if test "$enable_targets" = all ; then
392 all_targets=true
393 else
394 for targ in `echo $enable_targets | sed 's/,/ /g'`
395 do
396 result=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $targ 2>/dev/null`
397 if test -n "$result" ; then
398 canon_targets="$canon_targets $result"
399 fi
400 done
401 fi
402fi
403
404# Convert the target names into GDB [*]-tdep.c names
405changequote(,)dnl
406selarchs=
407for targ in $target $canon_targets
408do
409 if test "x$targ" = "xall" ; then
410 all_targets=true
411 else
b0f33a03 412 t_cpu=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'`
287026b7 413 t_vendor=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'`
b0f33a03 414 t_os=`echo $targ | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
287026b7
AC
415 mt=`
416target=$targ
417target_cpu=$t_cpu
418target_vendor=$t_vendor
419target_os=$t_os
420. ${srcdir}/configure.tgt
421echo ${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt`
422 if test -r ${mt} ; then
423 # This gets confused over .mt files that have multiple -tdep.o
424 tdep=`sed -n '
425s/^.*[ =]\([^ ]*\)-tdep.o.*/\1/p
426' $mt`
427 selarchs="$selarchs $tdep"
428 fi
429 fi
430done
431changequote([,])dnl
432
433# We don't do any links based on the target system, just makefile config.
434
435if test x${all_targets} = xfalse ; then
436
437 # Target architecture .o files.
438 ta=
439
440 for arch in $selarchs
441 do
442 archdefs="$archdefs -DARCH_$arch"
443 ta="$ta ${arch}-tdep.o"
444 # Special cases
445 case "$arch" in
b0f33a03 446 dvp) ta="$ta mips-tdep.o dvp-tdep.o" ;;
287026b7
AC
447 esac
448 done
449
450 # Weed out duplicate .o files.
451 f=""
452 for i in $ta ; do
453 case " $f " in
b0f33a03
JM
454 *" $i "*) ;;
455 *) f="$f $i" ;;
287026b7
AC
456 esac
457 done
458 ta="$f"
459
460 # And duplicate -D flags.
461 f=""
462 for i in $archdefs ; do
463 case " $f " in
b0f33a03
JM
464 *" $i "*) ;;
465 *) f="$f $i" ;;
287026b7
AC
466 esac
467 done
468 archdefs="$f"
469
470 MACHINE_OBS="$ta"
471
472else # all_targets is true
473 archdefs=-DARCH_all
474 MACHINE_OBS='$(ALL_MACHINES)'
475fi
476
477dnl Don't define an archdefs list
478dnl AC_SUBST(archdefs)
479dnl XXXX this name will change several more times
480if test "${enable_carp}" = yes ; then
481 gdb_target=carp
482 gdb_target_cpu=carp
483else
484 MACHINE_OBS="# $MACHINE_OBS"
485fi
486AC_SUBST(MACHINE_OBS)
487
488# end-sanitize-carp
5436fc65 489# start-sanitize-gdbtk
fa41e1a3 490# start-sanitize-ide
2476848a
MH
491ENABLE_IDE=
492AC_ARG_ENABLE(ide, [ --enable-ide Enable IDE support])
493if test "$enable_ide" = yes; then
494 enable_ide=yes
495 ENABLE_IDE=1
496else
497 enable_ide=no
498fi
499AC_SUBST(ENABLE_IDE)
500
c076f1ed 501AC_ARG_WITH(foundry-libs,
ba68ad57 502[ --with-foundry-libs=DIR Use the Foundry SDK in DIR],
c076f1ed
DM
503[FOUNDRY_LIB_BASE=${withval}])
504AC_SUBST(FOUNDRY_LIB_BASE)
505
506#
507# This is the Foundry SDK
508#
509# These variables are used to determine where the Foundry libs and
510# header files are located.
511#
512if test "$FOUNDRY_LIB_BASE" != ""; then
513 LIBGUI="${FOUNDRY_LIB_BASE}/lib/libgui.a"
514 GUI_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
515 if test x$enable_ide = xyes; then
516 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include -DIDE"
517 IDE_X="-L${FOUNDRY_LIB_BASE}/lib -lilu-Tk -lilu-c -lilu"
518 else
519 IDE_CFLAGS_X="-I${FOUNDRY_LIB_BASE}/include"
520 fi
521 LIBIDETCL="${FOUNDRY_LIB_BASE}/lib/libidetcl.a"
522 LIBIDE="${FOUNDRY_LIB_BASE}/lib/libide.a"
523 IDE_DEPS="${FOUNDRY_LIB_BASE}/lib/libilu-Tk.a ${FOUNDRY_LIB_BASE}/lib/libilu-c.a ${FOUNDRY_LIB_BASE}/lib/libilu.a"
524else
44ffbd6e 525# end-sanitize-ide
c076f1ed
DM
526 LIBGUI="../libgui/src/libgui.a"
527 GUI_CFLAGS_X="-I${srcdir}/../libgui/src"
44ffbd6e 528# start-sanitize-ide
c076f1ed
DM
529 if test x$enable_ide = xyes; then
530 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src -DIDE -I${srcdir}/../ilu/runtime/mainloop"
531 IDE_X="-L../ilu/runtime/mainloop -lilu-Tk -L../ilu/runtime/c -lilu-c -L../ilu/runtime/kernel -lilu"
532 else
533 IDE_CFLAGS_X="-I${srcdir}/../libidetcl/src -I${srcdir}/../libide/src"
534 fi
535 LIBIDETCL="../libidetcl/src/libidetcl.a"
536 LIBIDE="../libide/src/libide.a"
537 IDE_DEPS="../ilu/runtime/mainloop/libilu-Tk.a ../ilu/runtime/c/libilu-c.a ../ilu/runtime/kernel/libilu.a"
538fi
44ffbd6e
JI
539
540# end-sanitize-ide
c076f1ed
DM
541AC_SUBST(LIBGUI)
542AC_SUBST(GUI_CFLAGS_X)
44ffbd6e 543# start-sanitize-ide
c076f1ed
DM
544AC_SUBST(IDE_CFLAGS_X)
545AC_SUBST(IDE_X)
546AC_SUBST(LIBIDETCL)
547AC_SUBST(LIBIDE)
548AC_SUBST(IDE_DEPS)
fa41e1a3 549# end-sanitize-ide
c076f1ed 550
2ac058fd
JB
551
552AC_ARG_WITH(cpu,
553[ --with-cpu=CPU set the default CPU variant to debug],
554[case "${target}" in
555 powerpc-* | powerpcle-* )
556 ## It would be nice to keep this table in sync with the one in
557 ## gcc/configure.
558 case "${with_cpu}" in
559 ppc-uisa | rs6000 | 403 | 403GC | 505 | 860 | 601 | 602 | 603 \
560 | 604 | 750 )
561 ## Those are all handled in variants in rs6000-tdep.c, so they're fine.
562 ;;
563 common | power | power2 | rios | rios1 | rios2 | rsc | rsc1 )
564 ## These are all RS6000 variants, as far as GDB is concerned.
565 with_cpu=rs6000
566 ;;
567 603e | ec603e )
568 with_cpu=603
569 ;;
570 604e )
571 with_cpu=604
572 ;;
573 * )
574 AC_MSG_WARN(GDB: unknown --with-cpu value: \`${with_cpu}'; using \`ppc-uisa'.)
575 with_cpu=ppc-uisa
576 ;;
577 esac
578 ;;
579 * )
580 AC_MSG_WARN(GDB may ignore the --with-cpu flag for ${target} targets)
581 ;;
582esac
583AC_DEFINE_UNQUOTED(TARGET_CPU_DEFAULT, "${with_cpu}")
584],)
585
586
5436fc65
C
587ENABLE_GDBTK=
588
589AC_ARG_ENABLE(gdbtk,
ba68ad57 590[ --enable-gdbtk Enable GDBTK GUI front end],
5436fc65 591[case "${enableval}" in
0fe1522a
SG
592 yes)
593 case "$host" in
594 *go32*)
595 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
596 enable_gdbtk=no ;;
8a19b35a 597 *windows*)
b613bfbf
GN
598 AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.])
599 enable_gdbtk=no ;;
0fe1522a
SG
600 *)
601 enable_gdbtk=yes ;;
602 esac ;;
603 no)
604 enable_gdbtk=no ;;
605 *)
606 AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;;
607esac],
608[
b93f016b 609# Default is on for everything but go32 and Cygwin
0fe1522a 610case "$host" in
8a19b35a 611 *go32* | *windows*)
b613bfbf 612 ;;
0fe1522a
SG
613 *)
614 enable_gdbtk=yes ;;
615 esac
616])
5436fc65 617
b93f016b 618# In the Cygwin environment, we need some additional flags.
d836385e 619AC_CACHE_CHECK([for cygwin], gdb_cv_os_cygwin,
9b119644 620[AC_EGREP_CPP(lose, [
94a91918 621#ifdef __CYGWIN32__
9b119644 622lose
d836385e 623#endif],[gdb_cv_os_cygwin=yes],[gdb_cv_os_cygwin=no])])
9b119644 624
2ab6ecfc
CF
625dnl Figure out which term library to use.
626if test x$gdb_cv_os_cygwin = xyes; then
627 TERM_LIB='`if test -r ../libtermcap/libtermcap.a; then echo ../libtermcap/libtermcap.a; else echo -ltermcap; fi`'
628else
629 TERM_LIB=
630 AC_CHECK_LIB(ncurses, tgetent, TERM_LIB=-lncurses,
631 AC_CHECK_LIB(termlib, tgetent, TERM_LIB=-ltermlib,
632 AC_CHECK_LIB(termcap, tgetent, TERM_LIB=-ltermcap,
633 AC_CHECK_LIB(curses, tgetent, TERM_LIB=-lcurses,
634 AC_CHECK_LIB(terminfo, tgetent, TERM_LIB=-lterminfo)))))
635
636 if test "x$TERM_LIB" = x
637 then
638 AC_MSG_ERROR(Could not find a term library, e.g. termcap or termlib!)
639 fi
640fi
641
9b119644
ILT
642WIN32LIBS=
643WIN32LDAPP=
644AC_SUBST(WIN32LIBS)
645AC_SUBST(WIN32LDAPP)
646
b0f33a03 647DLLTOOL=${DLLTOOL-dlltool}
929db6e5 648WINDRES=${WINDRES-windres}
b0f33a03 649AC_SUBST(DLLTOOL)
929db6e5
EZ
650AC_SUBST(WINDRES)
651
d836385e 652if test x$gdb_cv_os_cygwin = xyes; then
040bbbc2 653 WIN32LIBS="-luser32"
9b119644 654 if test x$enable_ide = xyes; then
040bbbc2 655 WIN32LIBS="$WIN32LIBS -ladvapi32"
9b119644
ILT
656 fi
657fi
658
659configdir="unix"
8a19b35a 660
b177bf84 661GDBTKLIBS=
5436fc65 662if test "${enable_gdbtk}" = "yes"; then
0fe1522a 663
047465fd 664 CY_AC_PATH_TCLCONFIG
0cf433d9
ILT
665 if test -z "${no_tcl}"; then
666 CY_AC_LOAD_TCLCONFIG
667 CY_AC_PATH_TKCONFIG
047465fd 668
0cf433d9
ILT
669 # If $no_tk is nonempty, then we can't do Tk, and there is no
670 # point to doing Tcl.
671 if test -z "${no_tk}"; then
672 CY_AC_LOAD_TKCONFIG
673 CY_AC_PATH_TCLH
674 CY_AC_PATH_TKH
2476848a 675 CY_AC_PATH_ITCLH
c98fe0c1 676 CY_AC_PATH_ITKH
b11485da 677 CY_AC_PATH_TIXH
047465fd 678
c98fe0c1
JI
679 # now look for Itcl library stuff
680
681 CY_AC_PATH_ITCLCONFIG
682 if test -z "${no_itcl}"; then
683 CY_AC_LOAD_ITCLCONFIG
684 case "${host}" in
685 *-*-cygwin32*)
686 itcldir=../itcl/itcl/win/
687 ;;
688 *)
689 itcldir=../itcl/itcl/unix/
690 ;;
691 esac
692
693
694 ITCLLIB="${ITCL_BUILD_LIB_SPEC}"
695 ITCL_DEPS="${itcldir}${ITCL_LIB_FILE}"
696 fi
697
698
699 # now look for Itk library stuff
700 CY_AC_PATH_ITKCONFIG
701 if test -z "${no_itcl}"; then
702 CY_AC_LOAD_ITKCONFIG
703
704 case "${host}" in
705 *-*-cygwin32*)
706 itkdir=../itcl/itk/win/
707 ;;
708 *)
709 itkdir=../itcl/itk/unix/
710 ;;
711 esac
712
713 ITKLIB="${ITK_BUILD_LIB_SPEC}"
714 ITK_DEPS="${itkdir}${ITK_LIB_FILE}"
715 fi
716
b11485da
JI
717 # now look for Tix library stuff
718 CY_AC_PATH_TIXCONFIG
719 if test -z "${no_tix}"; then
720 CY_AC_LOAD_TIXCONFIG
721 TIXLIB="${TIX_BUILD_LIB_SPEC}"
722 TIX_DEPS="${TIX_BUILD_LOCATION}/${TIX_LIB_FILE}"
723 fi
6bc5b2fa 724
0cf433d9 725 ENABLE_GDBTK=1
509b70ac 726 ENABLE_CFLAGS="${ENABLE_CFLAGS} -DGDBTK"
b11485da
JI
727 # Tcl/Tk 8.1 require -fwritable strings. I don't
728 # know whether 8.2 will or not, but I bet it will.
729 # I don't have to worry about 7.x since we don't support it.
730 GDBTK_CFLAGS=""
731 if test ${GCC} = "yes"; then
732 if test ${TCL_VERSION} != "8.0" ; then
733 GDBTK_CFLAGS="-fwritable-strings"
734 fi
735 fi
1a57cd09 736
6c310da8 737 # Include some libraries that Tcl and Tk want.
2476848a 738 if test "${enable_ide}" = "yes"; then
b11485da 739 TCL_LIBS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE) $(ITCL) $(ITK) $(TIXLIB) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
8b5befef 740 CONFIG_DEPS='$(LIBIDETCL) $(LIBIDE) $(LIBGUI) $(IDE_DEPS) $(ITCL_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
2476848a 741 else
c98fe0c1
JI
742 TCL_LIBS='$(LIBGUI) $(ITCL) $(ITK) $(TIX) $(TK) $(TCL) $(X11_LDFLAGS) $(X11_LIBS)'
743 CONFIG_DEPS='$(LIBGUI) $(ITCL_DEPS) $(ITK_DEPS) $(TIX_DEPS) $(TK_DEPS) $(TCL_DEPS)'
2476848a 744 fi
46964086
TT
745 # Yes, the ordering seems wrong here. But it isn't.
746 # TK_LIBS is the list of libraries that need to be linked
b177bf84
TT
747 # after Tcl/Tk. Note that this isn't put into LIBS. If it
748 # were in LIBS then any link tests after this point would
749 # try to include things like `$(LIBGUI)', which wouldn't work.
750 GDBTKLIBS="${TCL_LIBS} ${TK_LIBS}"
c98fe0c1 751 CONFIG_OBS="${CONFIG_OBS} gdbtk.o gdbtk-cmds.o gdbtk-hooks.o gdbtk-variable.o gdbtk-wrapper.o"
9b119644 752
d836385e 753 if test x$gdb_cv_os_cygwin = xyes; then
040bbbc2 754 WIN32LIBS="${WIN32LIBS} -lshell32 -lgdi32 -lcomdlg32 -ladvapi32"
47792960 755 WIN32LDAPP="-Wl,--subsystem,console"
929db6e5 756 CONFIG_OBS="${CONFIG_OBS} gdbres.o"
9b119644 757 fi
0cf433d9 758 fi
a2b63bbd 759 fi
5436fc65 760fi
a2b63bbd 761
5436fc65 762AC_SUBST(ENABLE_GDBTK)
9c0bc1da 763AC_SUBST(X_CFLAGS)
a2b63bbd
JM
764AC_SUBST(X_LDFLAGS)
765AC_SUBST(X_LIBS)
c98fe0c1
JI
766AC_SUBST(ITCLLIB)
767AC_SUBST(ITCL_DEPS)
768AC_SUBST(ITKLIB)
769AC_SUBST(ITK_DEPS)
6bc5b2fa 770AC_SUBST(TIXLIB)
018d76dd 771AC_SUBST(TIX_DEPS)
b177bf84 772AC_SUBST(GDBTKLIBS)
b11485da 773AC_SUBST(GDBTK_CFLAGS)
5436fc65
C
774# end-sanitize-gdbtk
775
b236defa
FCE
776AC_PATH_X
777# start-sanitize-sky
778# Enable GPU2 library for MIPS simulator
779AC_ARG_WITH(sim-gpu2,
ba68ad57 780[ --with-sim-gpu2=DIR Use GPU2 library under given DIR],
bd5eafcd 781[case "${target}" in
af3711e6 782 mips*-sky*-*)
bd5eafcd
FCE
783 if test -d "${withval}"
784 then
852b7d11
JM
785 if test x${x_libraries} != x
786 then
787 LIBS="${LIBS} -L${withval}/lib -lgpu2 -L${x_libraries} -lX11 -lXext -lm"
788 else
789 LIBS="${LIBS} -L${withval}/lib -lgpu2 -lX11 -lXext -lm"
790 fi
bd5eafcd
FCE
791 else
792 AC_MSG_WARN([Directory ${withval} does not exist.])
793 fi ;;
794 *) AC_MSG_WARN([--with-sim-gpu2 option invalid for target ${target}])
795esac])dnl
3e5fbf91
JL
796
797# Enable target accurate FP library
798AC_ARG_WITH(sim-funit,
ba68ad57 799[ --with-sim-funit=DIR Use target FP lib under given DIR],
3e5fbf91 800[case "${target}" in
af3711e6 801 mips*-sky*-*)
3e5fbf91
JL
802 if test -d "${withval}"
803 then
804 LIBS="${LIBS} -L${withval}/lib -lfunit"
805 else
806 AC_MSG_WARN([Directory ${withval} does not exist.])
807 fi ;;
808 *) AC_MSG_WARN([--with-sim-funit option invalid for target ${target}])
809esac])dnl
b236defa
FCE
810# end-sanitize-sky
811
5436fc65 812AC_SUBST(ENABLE_CFLAGS)
6c310da8
SG
813
814AC_SUBST(CONFIG_OBS)
018d76dd 815AC_SUBST(CONFIG_DEPS)
c7bb1531 816AC_SUBST(CONFIG_SRCS)
6ec7e4d3 817
1d5eb137
FF
818# Begin stuff to support --enable-shared
819AC_ARG_ENABLE(shared,
ba68ad57 820[ --enable-shared Use shared libraries],
1d5eb137
FF
821[case "${enableval}" in
822 yes) shared=true ;;
823 no) shared=false ;;
824 *) shared=true ;;
825esac])dnl
826
827HLDFLAGS=
828HLDENV=
829# If we have shared libraries, try to set rpath reasonably.
830if test "${shared}" = "true"; then
831 case "${host}" in
832 *-*-hpux*)
833 HLDFLAGS='-Wl,+s,+b,$(libdir)'
834 ;;
835 *-*-irix5* | *-*-irix6*)
836 HLDFLAGS='-Wl,-rpath,$(libdir)'
837 ;;
838 *-*-linux*aout*)
839 ;;
8ddf07a2 840 *-*-linux* | *-pc-linux-gnu)
1d5eb137
FF
841 HLDFLAGS='-Wl,-rpath,$(libdir)'
842 ;;
843 *-*-solaris*)
844 HLDFLAGS='-R $(libdir)'
845 ;;
846 *-*-sysv4*)
847 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;'
848 ;;
849 esac
850fi
851
852# On SunOS, if the linker supports the -rpath option, use it to
853# prevent ../bfd and ../opcodes from being included in the run time
854# search path.
855case "${host}" in
856 *-*-sunos*)
857 echo 'main () { }' > conftest.c
858 ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t
859 if grep 'unrecognized' conftest.t >/dev/null 2>&1; then
860 :
861 elif grep 'No such file' conftest.t >/dev/null 2>&1; then
862 :
863 elif grep 'do not mix' conftest.t >/dev/null 2>&1; then
864 :
074d813d
PS
865 elif grep 'some text already loaded' conftest.t >/dev/null 2>&1; then
866 :
1d5eb137
FF
867 elif test "${shared}" = "true"; then
868 HLDFLAGS='-Wl,-rpath=$(libdir)'
869 else
870 HLDFLAGS='-Wl,-rpath='
871 fi
872 rm -f conftest.t conftest.c conftest
873 ;;
874esac
875AC_SUBST(HLDFLAGS)
876AC_SUBST(HLDENV)
877# End stuff to support --enable-shared
878
9c0bc1da
DE
879# target_subdir is used by the testsuite to find the target libraries.
880target_subdir=
881if test "${host}" != "${target}"; then
882 target_subdir="${target_alias}/"
883fi
884AC_SUBST(target_subdir)
bc028766 885
5f107900 886frags=
5436fc65
C
887host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
888if test ! -f ${host_makefile_frag}; then
889AC_MSG_ERROR("*** Gdb does not support host ${host}")
912e0732 890fi
5f107900 891frags="$frags $host_makefile_frag"
912e0732 892
5436fc65
C
893target_makefile_frag=${srcdir}/config/${gdb_target_cpu}/${gdb_target}.mt
894if test ! -f ${target_makefile_frag}; then
895AC_MSG_ERROR("*** Gdb does not support target ${target}")
912e0732 896fi
5f107900 897frags="$frags $target_makefile_frag"
912e0732 898
5436fc65
C
899AC_SUBST_FILE(host_makefile_frag)
900AC_SUBST_FILE(target_makefile_frag)
5f107900 901AC_SUBST(frags)
5436fc65 902
094fd4ae
C
903changequote(,)dnl
904hostfile=`sed -n '
905s/XM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
906' ${host_makefile_frag}`
5436fc65 907
094fd4ae
C
908targetfile=`sed -n '
909s/TM_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
910' ${target_makefile_frag}`
79f68f0f
DZ
911
912# these really aren't orthogonal true/false values of the same condition,
913# but shells are slow enough that I like to reuse the test conditions
914# whenever possible
5436fc65 915if test "${target}" = "${host}"; then
094fd4ae
C
916nativefile=`sed -n '
917s/NAT_FILE[ ]*=[ ]*\([^ ]*\)/\1/p
918' ${host_makefile_frag}`
33ef0f93 919# else
5436fc65 920# GDBserver is only useful in a "native" enviroment
33ef0f93 921# configdirs=`echo $configdirs | sed 's/gdbserver//'`
d40309c7 922fi
094fd4ae 923changequote([,])
d40309c7 924
d40309c7 925# If hostfile (XM_FILE) and/or targetfile (TM_FILE) and/or nativefile
6573c898 926# (NAT_FILE) is not set in config/*/*.m[ht] files, we don't make the
d40309c7
JG
927# corresponding links. But we have to remove the xm.h files and tm.h
928# files anyway, e.g. when switching from "configure host" to
929# "configure none".
930
bdf3621b
JG
931files=
932links=
dc0c3f64 933rm -f xm.h
5436fc65
C
934if test "${hostfile}" != ""; then
935files="${files} config/${gdb_host_cpu}/${hostfile}"
936links="${links} xm.h"
bdf3621b 937fi
dc0c3f64 938rm -f tm.h
5436fc65
C
939if test "${targetfile}" != ""; then
940files="${files} config/${gdb_target_cpu}/${targetfile}"
941links="${links} tm.h"
bdf3621b 942fi
1a0edbc7 943rm -f nm.h
5436fc65
C
944if test "${nativefile}" != ""; then
945files="${files} config/${gdb_host_cpu}/${nativefile}"
946links="${links} nm.h"
c9c23412 947else
5436fc65
C
948# A cross-only configuration.
949files="${files} config/nm-empty.h"
950links="${links} nm.h"
d40309c7 951fi
d3d75ec9 952# start-sanitize-gdbtk
99174711 953AC_PROG_LN_S
5436fc65 954# Make it possible to use the GUI without doing a full install
454e0c7d
AC
955if test "${enable_gdbtk}" = "yes" -a ! -d gdbtcl2 ; then
956 if test "$LN_S" = "ln -s" -a ! -f gdbtcl2 ; then
957 echo linking $srcdir/gdbtcl2 to gdbtcl2
958 $LN_S $srcdir/gdbtcl2 gdbtcl2
99174711 959 else
454e0c7d 960 echo Warning: Unable to link $srcdir/gdbtcl2 to gdbtcl2. You will need to do a
99174711
JM
961 echo " " make install before you are able to run the GUI.
962 fi
754e5da2 963fi
d3d75ec9 964# end-sanitize-gdbtk
754e5da2 965
5436fc65
C
966AC_LINK_FILES($files, $links)
967
98fa4ade 968dnl Check for exe extension set on certain hosts (e.g. Win32)
0abbe35d 969AC_EXEEXT
98fa4ade 970
5436fc65 971AC_CONFIG_SUBDIRS($configdirs)
460845ab 972AC_OUTPUT(Makefile tui/Makefile .gdbinit:gdbinit.in,
5436fc65
C
973[
974dnl Autoconf doesn't provide a mechanism for modifying definitions
975dnl provided by makefile fragments.
976dnl
977if test "${nativefile}" = ""; then
7bd1f0c5 978sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \
5436fc65
C
979 < Makefile > Makefile.tem
980mv -f Makefile.tem Makefile
33bc979d
SS
981fi
982
5436fc65 983changequote(,)dnl
94d4b713
JK
984sed -e '/^TM_FILE[ ]*=/s,^TM_FILE[ ]*=[ ]*,&config/'"${gdb_target_cpu}"'/,
985/^XM_FILE[ ]*=/s,^XM_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,
986/^NAT_FILE[ ]*=/s,^NAT_FILE[ ]*=[ ]*,&config/'"${gdb_host_cpu}"'/,' <Makefile >Makefile.tmp
987mv -f Makefile.tmp Makefile
5436fc65
C
988changequote([,])dnl
989
31520669 990case x$CONFIG_HEADERS in
18ea4416 991xconfig.h:config.in)
31520669
FF
992echo > stamp-h ;;
993esac
0a5a1821
C
994],
995[
996gdb_host_cpu=$gdb_host_cpu
997gdb_target_cpu=$gdb_target_cpu
998nativefile=$nativefile
5436fc65 999])
5e711e7f
PS
1000
1001exit 0
This page took 0.372617 seconds and 4 git commands to generate.