This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch/rfc] Don't assume the host


Hello,

> Hello,
> 
> The attached patch should fix a problem Matthew Green reported with GDB insisting on needing to know the host.
> 
> It tweeks things to only insist on a *.mh file when a native configuration.
> 
> On potential problem - if there isn't a .mh file, it uses /dev/null. Not sure how robust that is.
> 
> Andrew


the attached is a revised patch.  The configure.in change is the same 
but this time it includes updates to gdbint.texinfo (Eli?).

One thing I noticed in tweeking the doco is that there is a mysterious 
but almost useless chapter ``Porting GDB''.  The information that 
chapter provides is also present elsewhere in a more complete form. 
I'll put that down on my todo list.

enjoy,
Andrew
2002-01-18  Andrew Cagney  <ac131313@redhat.com>

	* configure.in (host_makefile_frag): Only require a host makefile
	fragment when a native build.
	* configure: Re-generate.

Index: doc/ChangeLog
2002-01-18  Andrew Cagney  <ac131313@redhat.com>

	* gdbint.texinfo (Host Definition): Revise.  xm-xyz.h and xyz.mh
	are no longer needed.
	(Porting GDB): Add maintainer note about configure.host.

Index: configure.in
===================================================================
RCS file: /cvs/src/src/gdb/configure.in,v
retrieving revision 1.78
diff -p -r1.78 configure.in
*** configure.in	2002/01/05 22:06:38	1.78
--- configure.in	2002/01/18 21:50:53
*************** AC_SUBST(target_subdir)
*** 1203,1209 ****
  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}")
  fi
  frags="$frags $host_makefile_frag"
  
--- 1203,1216 ----
  frags=
  host_makefile_frag=${srcdir}/config/${gdb_host_cpu}/${gdb_host}.mh
  if test ! -f ${host_makefile_frag}; then
!     # 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 host ${host}")
!     else
! 	host_makefile_frag=/dev/null
!     fi
  fi
  frags="$frags $host_makefile_frag"
  
Index: doc/gdbint.texinfo
===================================================================
RCS file: /cvs/src/src/gdb/doc/gdbint.texinfo,v
retrieving revision 1.56
diff -p -r1.56 gdbint.texinfo
*** gdbint.texinfo	2002/01/18 04:51:10	1.56
--- gdbint.texinfo	2002/01/18 21:51:04
*************** distribution!
*** 2020,2057 ****
  
  @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.
  
  @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
  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},
  @code{SYSV_DEFINE}, @code{XM_CFLAGS}, @code{XM_ADD_FILES},
  @code{XM_CLIBS}, @code{XM_CDEPS}, etc.; see @file{Makefile.in}.
  
  @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.
  
  @end table
  
--- 2020,2063 ----
  
  @chapter Host Definition
  
  With the advent of Autoconf, it's rarely necessary to have host
! 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
! @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.
  
  @table @file
  @item gdb/config/@var{arch}/@var{xyz}.mh
! 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
! 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
  
*************** Several files control @value{GDBN}'s con
*** 3770,3776 ****
  @table @file
  @vindex NATDEPFILES
  @item gdb/config/@var{arch}/@var{xyz}.mh
! Specifies Makefile fragments needed when hosting @emph{or native} 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
--- 3776,3782 ----
  @table @file
  @vindex NATDEPFILES
  @item gdb/config/@var{arch}/@var{xyz}.mh
! 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
*************** Also specifies the header file which des
*** 3778,3783 ****
--- 3784,3796 ----
  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
*************** your system and set @code{gdb_host} to @
*** 4752,4757 ****
--- 4765,4777 ----
  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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]