gdbint_14.html   [plain text]


<HTML>
<HEAD>
<!-- This HTML file has been created by texi2html 1.51
     from /mnt/apple/gdb/source/gdb.apple/source/gdb/gdb/doc/gdbint.texinfo on 23 November 1999 -->

<TITLE>GDB Internals - Porting GDB</TITLE>
</HEAD>
<BODY>
Go to the <A HREF="gdbint_1.html">first</A>, <A HREF="gdbint_13.html">previous</A>, <A HREF="gdbint_15.html">next</A>, <A HREF="gdbint_16.html">last</A> section, <A HREF="gdbint_toc.html">table of contents</A>.
<P><HR><P>


<H1><A NAME="SEC99" HREF="gdbint_toc.html#TOC99">Porting GDB</A></H1>

<P>
Most of the work in making GDB compile on a new machine is in specifying
the configuration of the machine.  This is done in a dizzying variety of
header files and configuration scripts, which we hope to make more
sensible soon.  Let's say your new host is called an <VAR>xyz</VAR> (e.g.
<SAMP>`sun4'</SAMP>), and its full three-part configuration name is
<CODE><VAR>arch</VAR>-<VAR>xvend</VAR>-<VAR>xos</VAR></CODE> (e.g.  <SAMP>`sparc-sun-sunos4'</SAMP>).
In particular:

</P>
<P>
In the top level directory, edit <TT>`config.sub'</TT> and add <VAR>arch</VAR>,
<VAR>xvend</VAR>, and <VAR>xos</VAR> to the lists of supported architectures,
vendors, and operating systems near the bottom of the file.  Also, add
<VAR>xyz</VAR> as an alias that maps to
<CODE><VAR>arch</VAR>-<VAR>xvend</VAR>-<VAR>xos</VAR></CODE>.  You can test your changes by
running

</P>

<PRE>
./config.sub <VAR>xyz</VAR>
</PRE>

<P>
and

<PRE>
./config.sub <CODE><VAR>arch</VAR>-<VAR>xvend</VAR>-<VAR>xos</VAR></CODE>
</PRE>

<P>
which should both respond with <CODE><VAR>arch</VAR>-<VAR>xvend</VAR>-<VAR>xos</VAR></CODE>
and no error messages.

</P>
<P>
You need to port BFD, if that hasn't been done already.  Porting BFD is
beyond the scope of this manual.

</P>
<P>
To configure GDB itself, edit <TT>`gdb/configure.host'</TT> to recognize
your system and set <CODE>gdb_host</CODE> to <VAR>xyz</VAR>, and (unless your
desired target is already available) also edit <TT>`gdb/configure.tgt'</TT>,
setting <CODE>gdb_target</CODE> to something appropriate (for instance,
<VAR>xyz</VAR>).

</P>
<P>
Finally, you'll need to specify and define GDB's host-, native-, and
target-dependent <TT>`.h'</TT> and <TT>`.c'</TT> files used for your
configuration.

</P>


<H2><A NAME="SEC100" HREF="gdbint_toc.html#TOC100">Configuring GDB for Release</A></H2>

<P>
From the top level directory (containing <TT>`gdb'</TT>, <TT>`bfd'</TT>,
<TT>`libiberty'</TT>, and so on):

<PRE>
make -f Makefile.in gdb.tar.gz
</PRE>

<P>
This will properly configure, clean, rebuild any files that are
distributed pre-built (e.g. <TT>`c-exp.tab.c'</TT> or <TT>`refcard.ps'</TT>),
and will then make a tarfile.  (If the top level directory has already
been configured, you can just do <CODE>make gdb.tar.gz</CODE> instead.)

</P>
<P>
This procedure requires:

<UL>
<LI>symbolic links

<LI><CODE>makeinfo</CODE> (texinfo2 level)

<LI>TeX

<LI><CODE>dvips</CODE>

<LI><CODE>yacc</CODE> or <CODE>bison</CODE>

</UL>

<P>
... and the usual slew of utilities (<CODE>sed</CODE>, <CODE>tar</CODE>, etc.).

</P>

<H3>TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION</H3>

<P>
<TT>`gdb.texinfo'</TT> is currently marked up using the texinfo-2 macros,
which are not yet a default for anything (but we have to start using
them sometime).

</P>
<P>
For making paper, the only thing this implies is the right generation of
<TT>`texinfo.tex'</TT> needs to be included in the distribution.

</P>
<P>
For making info files, however, rather than duplicating the texinfo2
distribution, generate <TT>`gdb-all.texinfo'</TT> locally, and include the
files <TT>`gdb.info*'</TT> in the distribution.  Note the plural;
<CODE>makeinfo</CODE> will split the document into one overall file and five
or so included files.

</P>

<P><HR><P>
Go to the <A HREF="gdbint_1.html">first</A>, <A HREF="gdbint_13.html">previous</A>, <A HREF="gdbint_15.html">next</A>, <A HREF="gdbint_16.html">last</A> section, <A HREF="gdbint_toc.html">table of contents</A>.
</BODY>
</HTML>