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