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