X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=gdb%2Fconfigure.in;h=7e22e81689610e65658813329c428e63f75e6eae;hb=f6c6791e0a137081ebac38010d790531a05c6cb8;hp=7b549ce559a455e289162103eed3c689a4a44405;hpb=4915acadd4d308ebfc500c64394a7fb87104ffde;p=deliverable%2Fbinutils-gdb.git diff --git a/gdb/configure.in b/gdb/configure.in index 7b549ce559..7e22e81689 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -19,7 +19,7 @@ dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. dnl Process this file with autoconf to produce a configure script. -AC_PREREQ(2.3)dnl +AC_PREREQ(2.5)dnl AC_INIT(main.c) AC_CONFIG_HEADER(config.h:config.in) @@ -28,6 +28,8 @@ AC_AIX AC_MINIX AC_ISC_POSIX +AC_CANONICAL_SYSTEM + AC_PROG_INSTALL AC_CHECK_TOOL(AR, ar) AC_CHECK_TOOL(RANLIB, ranlib, :) @@ -35,15 +37,26 @@ AC_PROG_YACC AC_PROG_AWK AC_CONFIG_AUX_DIR(`cd $srcdir;pwd`/..) -AC_CANONICAL_SYSTEM AC_ARG_PROGRAM AC_HEADER_STDC -AC_CHECK_HEADERS(limits.h memory.h string.h strings.h unistd.h termios.h termio.h sgtty.h stddef.h sys/procfs.h link.h endian.h) +AC_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) AC_HEADER_STAT +AC_C_CONST + AC_CHECK_FUNCS(setpgid sbrk) +# If we are configured native on Linux, work around problems with sys/procfs.h +if test "${target}" = "${host}"; then + case "${host}" in + i[3456]86-*-linux*) + AC_DEFINE(START_INFERIOR_TRAPS_EXPECTED,"2") + AC_DEFINE(sys_quotactl) + ;; + esac +fi + AC_MSG_CHECKING([for gregset_t type]) AC_CACHE_VAL(gdb_cv_have_gregset_t, [AC_TRY_LINK([#include ],[gregset_t *gregsetp = 0], @@ -62,6 +75,39 @@ if test $gdb_cv_have_fpregset_t = yes; then AC_DEFINE(HAVE_FPREGSET_T) fi +dnl See if compiler supports "long long" type. + +AC_MSG_CHECKING(for long long support in compiler) +AC_CACHE_VAL(gdb_cv_c_long_long, +[AC_TRY_COMPILE(, [ + extern long long foo; + switch (foo & 2) { case 0: return 1; } +], +gdb_cv_c_long_long=yes, gdb_cv_c_long_long=no)]) +AC_MSG_RESULT($gdb_cv_c_long_long) +if test $gdb_cv_c_long_long = yes; then + AC_DEFINE(CC_HAS_LONG_LONG) +fi + +dnl See if the compiler and runtime support printing long long + +AC_MSG_CHECKING(for long long support in printf) +AC_CACHE_VAL(gdb_cv_printf_has_long_long, +[AC_TRY_RUN([ +int main () { + char buf[16]; + long long l = 0x12345; + sprintf (buf, "%llx", l); + return (strcmp ("12345", buf)); +}], +gdb_cv_printf_has_long_long=yes, +gdb_cv_printf_has_long_long=no, +gdb_cv_printf_has_long_long=no)]) +if test $gdb_cv_printf_has_long_long = yes; then + AC_DEFINE(PRINTF_HAS_LONG_LONG) +fi +AC_MSG_RESULT($gdb_cv_printf_has_long_long) + dnl See if compiler supports "long double" type. Can't use AC_C_LONG_DOUBLE dnl because autoconf complains about cross-compilation issues. However, this dnl code uses the same variables as the macro for compatibility. @@ -96,11 +142,18 @@ AC_MSG_RESULT($gdb_cv_printf_has_long_double) AC_FUNC_MMAP +BFD_NEED_DECLARATION(malloc) +BFD_NEED_DECLARATION(realloc) +BFD_NEED_DECLARATION(free) + dnl See if thread_db library is around for Solaris thread debugging. Note that dnl we must explicitly test for version 1 of the library because version 0 dnl (present on Solaris 2.4 or earlier) doesn't have the same API. -if test ${host} = ${target} ; then +dnl Note that we only want this if we are both native (host == target), and +dnl not doing a canadian cross build (build == host). + +if test ${build} = ${host} -a ${host} = ${target} ; then AC_MSG_CHECKING(for Solaris thread debugging library) if test -f /usr/lib/libthread_db.so.1 ; then AC_MSG_RESULT(yes) @@ -165,6 +218,9 @@ AC_ARG_ENABLE(gdbtk, *go32*) AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.]) enable_gdbtk=no ;; + *cygwin32* | *windows*) + AC_MSG_WARN([GDB does not support GDBtk on host ${host}. GDBtk will be disabled.]) + enable_gdbtk=no ;; *) enable_gdbtk=yes ;; esac ;; @@ -174,9 +230,9 @@ AC_ARG_ENABLE(gdbtk, AC_MSG_ERROR(bad value ${enableval} given for gdbtk option) ;; esac], [ -# Default is on for everything but go32 +# Default is on for everything but go32 and cygwin32 case "$host" in - *go32*) + *go32* | *cygwin32* | *windows*) ;; *) enable_gdbtk=yes ;; @@ -185,78 +241,28 @@ case "$host" in if test "${enable_gdbtk}" = "yes"; then - AC_PATH_X - AC_PATH_XTRA + CY_AC_PATH_TCLCONFIG + if test -z "${no_tcl}"; then + CY_AC_LOAD_TCLCONFIG + CY_AC_PATH_TKCONFIG - CY_AC_PATH_TCL - CY_AC_PATH_TK + # If $no_tk is nonempty, then we can't do Tk, and there is no + # point to doing Tcl. + if test -z "${no_tk}"; then + CY_AC_LOAD_TKCONFIG + CY_AC_PATH_TCLH + CY_AC_PATH_TKH - # Look for dynamic linking libraries that Tcl might need. This is - # only done for Tcl 7.5 and greater. It would be good to look for and - # use the "configInfo" file that Tcl generates, but for now that is - # beyond us. - if test $tclmajor -ge 7 -a $tclminor -ge 5 ; then - AC_CHECK_LIB(dl, main, , AC_CHECK_LIB(dld, main)) - fi + # Include some libraries that Tcl and Tk want. + LIBS="$LIBS $TK_LIBS" - ENABLE_GDBTK=1 - - if test "x$no_x" != "xyes"; then - if test "x$x_includes" != "x" ; - then - X_CFLAGS="-I$x_includes" - else - X_CFLAGS="" - fi - - if test "x$x_libraries" != "x" ; - then - X_LDFLAGS="-L$x_libraries" - else - X_LDFLAGS="" - fi - - case "$host" in -# -# gdb linked statically w/ Solaris iff GCC is used, otherwise dynamic -# - sparc*-sun-solaris2*) - if test "x$GCC" = "xyes"; - then - X_LIBS="-Wl,-Bstatic -lX11 -lXext -lX11 -Wl,-Bdynamic -ldl -lw" - else - if test "x$x_libraries" != "x" ; - then - X_LDFLAGS="$X_LDFLAGS -R$x_libraries" - fi - X_LIBS="-lX11 -lXext -lX11" - fi ;; -# -# gdb linked statically w/ SunOS or HPUX -# - m68k-hp-hpux*|hppa*-hp-hpux*|sparc-sun-sunos*) - if test "x$x_libraries" != "x" ; - then - X_LIBS="$x_libraries/libX11.a" - else - X_LIBS="/usr/lib/libX11.a" - fi ;; -# -# default is to link dynamically -# - *) - X_LIBS="-lX11" ;; - esac - else - X_LDLAGS="" - X_CFLAGS="" - X_LIBS="" - AC_MSG_WARN([No X based programs will be built]) + ENABLE_GDBTK=1 + + TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)' + ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS}" + ENABLE_OBS="${ENABLE_OBS} gdbtk.o" + fi fi - - TCL_LIBS='$(TCL) $(TK) $(X11_LDFLAGS) $(X11_LIBS)' - ENABLE_CLIBS="${ENABLE_CLIBS} ${TCL_LIBS} -lm" - ENABLE_OBS="${ENABLE_OBS} gdbtk.o" fi AC_SUBST(ENABLE_GDBTK) @@ -269,6 +275,65 @@ AC_SUBST(ENABLE_CFLAGS) AC_SUBST(ENABLE_CLIBS) AC_SUBST(ENABLE_OBS) +# Begin stuff to support --enable-shared +AC_ARG_ENABLE(shared, +[ --enable-shared use shared libraries], +[case "${enableval}" in + yes) shared=true ;; + no) shared=false ;; + *) shared=true ;; +esac])dnl + +HLDFLAGS= +HLDENV= +# If we have shared libraries, try to set rpath reasonably. +if test "${shared}" = "true"; then + case "${host}" in + *-*-hpux*) + HLDFLAGS='-Wl,+s,+b,$(libdir)' + ;; + *-*-irix5* | *-*-irix6*) + HLDFLAGS='-Wl,-rpath,$(libdir)' + ;; + *-*-linux*aout*) + ;; + *-*-linux*) + HLDFLAGS='-Wl,-rpath,$(libdir)' + ;; + *-*-solaris*) + HLDFLAGS='-R $(libdir)' + ;; + *-*-sysv4*) + 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;' + ;; + esac +fi + +# On SunOS, if the linker supports the -rpath option, use it to +# prevent ../bfd and ../opcodes from being included in the run time +# search path. +case "${host}" in + *-*-sunos*) + echo 'main () { }' > conftest.c + ${CC} -o conftest -Wl,-rpath= conftest.c >/dev/null 2>conftest.t + if grep 'unrecognized' conftest.t >/dev/null 2>&1; then + : + elif grep 'No such file' conftest.t >/dev/null 2>&1; then + : + elif grep 'do not mix' conftest.t >/dev/null 2>&1; then + : + elif test "${shared}" = "true"; then + HLDFLAGS='-Wl,-rpath=$(libdir)' + else + HLDFLAGS='-Wl,-rpath=' + fi + rm -f conftest.t conftest.c conftest + ;; +esac +AC_SUBST(HLDFLAGS) +AC_SUBST(HLDENV) +# End stuff to support --enable-shared + # target_subdir is used by the testsuite to find the target libraries. target_subdir= if test "${host}" != "${target}"; then @@ -348,6 +413,8 @@ i[3456]86-*-sysv*) gdb_host=i386v ;; i[3456]86-*-isc*) gdb_host=i386v32 ;; i[3456]86-*-os9k) gdb_host=i386os9k ;; i[3456]86-*-cygwin32) gdb_host=cygwin32 ;; +i[3456]86-*-windows) gdb_host=windows + configdirs="${configdirs} mswin" ;; m680[01]0-sun-sunos3*) gdb_host=sun2os3 ;; m680[01]0-sun-sunos4*) gdb_host=sun2os4 ;; m68030-sony-*) gdb_host=news1000 ;; @@ -399,6 +466,7 @@ ns32k-utek-sysv*) gdb_host=merlin ;; powerpc-*-aix*) gdb_host=aix ;; powerpcle-*-cygwin32) gdb_host=cygwin32 ;; powerpcle-*-solaris*) gdb_host=solaris ;; +powerpc-*-linux*) gdb_host=linux ;; pn-*-*) gdb_host=pn ;; pyramid-*-*) gdb_host=pyramid ;; @@ -475,6 +543,10 @@ arm-*-*) gdb_target=arm ;; c1-*-*) gdb_target=convex ;; c2-*-*) gdb_target=convex ;; +# start-sanitize-d10v +d10v-*-*) gdb_target=d10v ;; +# end-sanitize-d10v + h8300-*-*) gdb_target=h8300 ;; h8500-*-*) gdb_target=h8500 ;; @@ -573,6 +645,8 @@ mips64*vr4300*el-*-elf*) gdb_target=vr4300el ;; mips64*vr4300*-*-elf*) gdb_target=vr4300 ;; mips64*vr4100*el-*-elf*) gdb_target=vr4300el ;; mips64*vr4100*-*-elf*) gdb_target=vr4300 ;; +mips64*vr5000*el-*-elf*) gdb_target=vr4300el ;; +mips64*vr5000*-*-elf*) gdb_target=vr4300 ;; mips64*el-*-elf*) gdb_target=embedl64 ;; mips64*-*-elf*) gdb_target=embed64 ;; mips*el-*-ecoff*) gdb_target=embedl ;; @@ -610,12 +684,14 @@ powerpc-*-aix4*) gdb_target=aix4 ;; powerpc-*-aix*) gdb_target=aix ;; powerpcle-*-cygwin32) gdb_target=cygwin32 ;; powerpcle-*-solaris*) gdb_target=solaris ;; -powerpc-*-eabi*) if test x"$powerpc_sim" = x"yes"; then +powerpc-*-eabi* | powerpc-*-linux* | powerpc-*-sysv* | powerpc-*-elf*) + if test x"$powerpc_sim" = x"yes"; then gdb_target=ppc-sim else gdb_target=ppc-eabi fi ;; -powerpcle-*-eabi*) if test x"$powerpc_sim" = x"yes"; then +powerpcle-*-eabi* | powerpcle-*-sysv* | powerpcle-*-elf*) + if test x"$powerpc_sim" = x"yes"; then gdb_target=ppcle-sim else gdb_target=ppcle-eabi @@ -638,8 +714,7 @@ sparc-*-sunos4*) gdb_target=sun4os4 ;; sparc-*-sunos5*) gdb_target=sun4sol2 ;; sparc-*-vxworks*) gdb_target=vxsparc ;; sparc-*-*) gdb_target=sun4os4 ;; -# Use sparc-em for sparclet for now. -sparclet-*-*) gdb_target=sparc-em ;; +sparclet-*-*) gdb_target=sparclet;; sparclite*-*-*) gdb_target=sparclite ;; # It's not clear what the right solution for "v8plus" systems is yet. # For now, stick with sparc-sun-solaris2 since that's what config.guess @@ -653,6 +728,10 @@ tahoe-*-*) gdb_target=tahoe ;; vax-*-*) gdb_target=vax ;; +start-sanitize-v850 +v850-*-*) gdb_target=v850 ;; + +end-sanitize-v850 w65-*-*) gdb_target=w65 ;; z8k-*-coff*) gdb_target=z8k ;; @@ -746,7 +825,7 @@ dnl Autoconf doesn't provide a mechanism for modifying definitions dnl provided by makefile fragments. dnl if test "${nativefile}" = ""; then -sed -e '/^NATDEPFILES= /s//# NATDEPFILES= /' \ +sed -e '/^NATDEPFILES[[ ]]*=[[ ]]*/s//# NATDEPFILES=/' \ < Makefile > Makefile.tem mv -f Makefile.tem Makefile fi