From 7fd605275856aa86a4ac6651ea2686fb937eb0a7 Mon Sep 17 00:00:00 2001 From: Andrew Cagney Date: Sun, 20 Jan 2002 18:19:30 +0000 Subject: [PATCH] Remove assumption that there is a host. --- gdb/ChangeLog | 6 +++++ gdb/configure | 27 ++++++++++++-------- gdb/configure.in | 9 ++++++- gdb/doc/ChangeLog | 6 +++++ gdb/doc/gdbint.texinfo | 58 ++++++++++++++++++++++++++++-------------- 5 files changed, 76 insertions(+), 30 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 11ec9979605..e3f1bb23ea8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2002-01-20 Andrew Cagney + + * configure.in (host_makefile_frag): Only require a host makefile + fragment when a native build. + * configure: Re-generate. + 2002-01-20 Andrew Cagney * doublest.h (floatformat_from_type): Declare. diff --git a/gdb/configure b/gdb/configure index 78e55f2f317..e34f29e5af9 100755 --- a/gdb/configure +++ b/gdb/configure @@ -8437,7 +8437,14 @@ fi frags= host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh if test ! -f ${host_makefile_frag}; then -{ echo "configure: error: "*** Gdb does not support host ${host}"" 1>&2; exit 1; } + # When building a native debuger the .mh file containing things + # like NATDEPFILES is needed. Cross debuggers don't need .mh + # since it no longer contains anything useful. + if test "${target}" = "${host}"; then + { echo "configure: error: "*** Gdb does not support native target ${host}"" 1>&2; exit 1; } + else + host_makefile_frag=/dev/null + fi fi frags="$frags $host_makefile_frag" @@ -8564,7 +8571,7 @@ fi echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 -echo "configure:8568: checking whether ln -s works" >&5 +echo "configure:8575: checking whether ln -s works" >&5 if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8588,12 +8595,12 @@ fi echo $ac_n "checking for Cygwin environment""... $ac_c" 1>&6 -echo "configure:8592: checking for Cygwin environment" >&5 +echo "configure:8599: checking for Cygwin environment" >&5 if eval "test \"`echo '$''{'ac_cv_cygwin'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8615: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_cygwin=yes else @@ -8621,19 +8628,19 @@ echo "$ac_t""$ac_cv_cygwin" 1>&6 CYGWIN= test "$ac_cv_cygwin" = yes && CYGWIN=yes echo $ac_n "checking for mingw32 environment""... $ac_c" 1>&6 -echo "configure:8625: checking for mingw32 environment" >&5 +echo "configure:8632: checking for mingw32 environment" >&5 if eval "test \"`echo '$''{'ac_cv_mingw32'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:8644: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_mingw32=yes else @@ -8652,7 +8659,7 @@ test "$ac_cv_mingw32" = yes && MINGW32=yes echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 -echo "configure:8656: checking for executable suffix" >&5 +echo "configure:8663: checking for executable suffix" >&5 if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -8662,7 +8669,7 @@ else rm -f conftest* echo 'int main () { return 0; }' > conftest.$ac_ext ac_cv_exeext= - if { (eval echo configure:8666: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + if { (eval echo configure:8673: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then for file in conftest.*; do case $file in *.c | *.o | *.obj | *.ilk | *.pdb) ;; diff --git a/gdb/configure.in b/gdb/configure.in index 6eef43cf884..25d7068016a 100644 --- a/gdb/configure.in +++ b/gdb/configure.in @@ -1203,7 +1203,14 @@ AC_SUBST(target_subdir) frags= host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh if test ! -f ${host_makefile_frag}; then -AC_MSG_ERROR("*** Gdb does not support host ${host}") + # When building a native debuger the .mh file containing things + # like NATDEPFILES is needed. Cross debuggers don't need .mh + # since it no longer contains anything useful. + if test "${target}" = "${host}"; then + AC_MSG_ERROR("*** Gdb does not support native target ${host}") + else + host_makefile_frag=/dev/null + fi fi frags="$frags $host_makefile_frag" diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index fe7cf210839..f94c1025fcc 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,9 @@ +2002-01-20 Andrew Cagney + + * gdbint.texinfo (Host Definition): Revise. xm-xyz.h and xyz.mh + are no longer needed. + (Porting GDB): Add maintainer note about configure.host. + 2002-01-20 Andrew Cagney * gdbint.texinfo (Target Architecture Definition): Remove diff --git a/gdb/doc/gdbint.texinfo b/gdb/doc/gdbint.texinfo index 515b30b2775..6605a768328 100644 --- a/gdb/doc/gdbint.texinfo +++ b/gdb/doc/gdbint.texinfo @@ -2020,38 +2020,44 @@ distribution! @chapter Host Definition -@emph{Maintainer's note: In theory, new targets no longer need to use -the host framework described below. Instead it should be possible to -handle everything using autoconf. Patches eliminating this framework -welcome.} - With the advent of Autoconf, it's rarely necessary to have host -definition machinery anymore. +definition machinery anymore. The following information is provided, +mainly, as an historical reference. @section Adding a New Host @cindex adding a new host @cindex host, adding -Most of @value{GDBN}'s host configuration support happens via -Autoconf. New host-specific definitions should be rarely needed. -@value{GDBN} still uses the host-specific definitions and files listed -below, but these mostly exist for historical reasons, and should +@value{GDBN}'s host configuration support normally happens via Autoconf. +New host-specific definitions should not be needed. Older hosts +@value{GDBN} still use the host-specific definitions and files listed +below, but these mostly exist for historical reasons, and will eventually disappear. -Several files control @value{GDBN}'s configuration for host systems: - @table @file @item gdb/config/@var{arch}/@var{xyz}.mh -Specifies Makefile fragments needed when hosting on machine @var{xyz}. -Optionally specifies the header file which describes host @var{xyz}, by -defining @code{XM_FILE= xm-@var{xyz}.h}. You can also define @code{CC}, +This file once contained both host and native configuration information +(@pxref{Native Debugging}) for the machine @var{xyz}. The host +configuration information is now handed by Autoconf. + +Host configuration information included a definition of +@code{XM_FILE=xm-@var{xyz}.h} and possibly definitions for @code{CC}, @code{SYSV_DEFINE}, @code{XM_CFLAGS}, @code{XM_ADD_FILES}, @code{XM_CLIBS}, @code{XM_CDEPS}, etc.; see @file{Makefile.in}. +New host only configurations do not need this file. + @item gdb/config/@var{arch}/xm-@var{xyz}.h -(@file{xm.h} is a link to this file, created by @code{configure}). Contains C -macro definitions describing the host system environment, such as byte -order, host C compiler and library. +This file once contained definitions and includes required when hosting +gdb on machine @var{xyz}. Those definitions and includes are now +handled by Autoconf. + +New host and native configurations do not need this file. + +@emph{Maintainer's note: Some hosts continue to use the @file{xm-xyz.h} +file to define the macros @var{HOST_FLOAT_FORMAT}, +@var{HOST_DOUBLE_FORMAT} and @var{HOST_LONG_DOUBLE_FORMAT}. That code +also needs to be replaced with either an Autoconf or run-time test.} @end table @@ -3762,7 +3768,7 @@ Several files control @value{GDBN}'s configuration for native support: @table @file @vindex NATDEPFILES @item gdb/config/@var{arch}/@var{xyz}.mh -Specifies Makefile fragments needed when hosting @emph{or native} on +Specifies Makefile fragments needed by a @emph{native} configuration on machine @var{xyz}. In particular, this lists the required native-dependent object files, by defining @samp{NATDEPFILES=@dots{}}. Also specifies the header file which describes native support on @@ -3770,6 +3776,13 @@ Also specifies the header file which describes native support on define @samp{NAT_CFLAGS}, @samp{NAT_ADD_FILES}, @samp{NAT_CLIBS}, @samp{NAT_CDEPS}, etc.; see @file{Makefile.in}. +@emph{Maintainer's note: The @file{.mh} suffix is because this file +originally contained @file{Makefile} fragments for hosting @value{GDBN} +on machine @var{xyz}. While the file is no longer used for this +purpose, the @file{.mh} suffix remains. Perhaphs someone will +eventually rename these fragments so that they have a @file{.mn} +suffix.} + @item gdb/config/@var{arch}/nm-@var{xyz}.h (@file{nm.h} is a link to this file, created by @code{configure}). Contains C macro definitions describing the native system environment, such as @@ -4745,6 +4758,13 @@ desired target is already available) also edit @file{gdb/configure.tgt}, setting @code{gdb_target} to something appropriate (for instance, @var{xyz}). +@emph{Maintainer's note: Work in progress. The file +@file{gdb/configure.host} originally needed to be modified when either a +new native target or a new host machine was being added to @value{GDBN}. +Recent changes have removed this requirement. The file now only needs +to be modified when adding a new native configuration. This will likely +changed again in the future.} + @item Finally, you'll need to specify and define @value{GDBN}'s host-, native-, and target-dependent @file{.h} and @file{.c} files used for your -- 2.30.2