Work around MinGW mangling of "host:/path"
[msysgit/historical-msysgit.git] / mingw / info / gdbint / Porting-GDB.html
blob735db1c6cba65f80b31c2b7d165678a6e3e429cc
1 <html lang="en">
2 <head>
3 <title>GDB Internals</title>
4 <meta http-equiv="Content-Type" content="text/html">
5 <meta name="description" content="GDB Internals">
6 <meta name="generator" content="makeinfo 4.3">
7 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home">
8 </head>
9 <body>
10 <div class="node">
11 <p>
12 Node:<a name="Porting%20GDB">Porting GDB</a>,
13 Next:<a rel="next" accesskey="n" href="Releasing-GDB.html#Releasing%20GDB">Releasing GDB</a>,
14 Previous:<a rel="previous" accesskey="p" href="Coding.html#Coding">Coding</a>,
15 Up:<a rel="up" accesskey="u" href="index.html#Top">Top</a>
16 <hr><br>
17 </div>
19 <h2 class="chapter">Porting GDB</h2>
21 <p>Most of the work in making GDB compile on a new machine is in
22 specifying the configuration of the machine. This is done in a
23 dizzying variety of header files and configuration scripts, which we
24 hope to make more sensible soon. Let's say your new host is called an
25 <var>xyz</var> (e.g., <code>sun4</code>), and its full three-part configuration
26 name is <code></code><var>arch</var><code>-</code><var>xvend</var><code>-</code><var>xos</var><code></code> (e.g.,
27 <code>sparc-sun-sunos4</code>). In particular:
29 <ul>
30 <li>In the top level directory, edit <code>config.sub</code> and add <var>arch</var>,
31 <var>xvend</var>, and <var>xos</var> to the lists of supported architectures,
32 vendors, and operating systems near the bottom of the file. Also, add
33 <var>xyz</var> as an alias that maps to
34 <code></code><var>arch</var><code>-</code><var>xvend</var><code>-</code><var>xos</var><code></code>. You can test your changes by
35 running
37 <pre class="example"> ./config.sub <var>xyz</var>
38 </pre>
40 <p>and
42 <pre class="example"> ./config.sub <code></code><var>arch</var><code>-</code><var>xvend</var><code>-</code><var>xos</var><code></code>
43 </pre>
45 <p>which should both respond with <code></code><var>arch</var><code>-</code><var>xvend</var><code>-</code><var>xos</var><code></code>
46 and no error messages.
48 <p>You need to port BFD, if that hasn't been done already. Porting BFD is
49 beyond the scope of this manual.
51 </p><li>To configure GDB itself, edit <code>gdb/configure.host</code> to recognize
52 your system and set <code>gdb_host</code> to <var>xyz</var>, and (unless your
53 desired target is already available) also edit <code>gdb/configure.tgt</code>,
54 setting <code>gdb_target</code> to something appropriate (for instance,
55 <var>xyz</var>).
57 <p><em>Maintainer's note: Work in progress. The file
58 </em><code>gdb/configure.host</code><em> originally needed to be modified when either a
59 new native target or a new host machine was being added to GDB.
60 Recent changes have removed this requirement. The file now only needs
61 to be modified when adding a new native configuration. This will likely
62 changed again in the future.</em>
64 <li>Finally, you'll need to specify and define GDB's host-, native-, and
65 target-dependent <code>.h</code> and <code>.c</code> files used for your
66 configuration.
67 </ul>
69 <h3 class="section">Configuring GDB for Release</h3>
71 <p>From the top level directory (containing <code>gdb</code>, <code>bfd</code>,
72 <code>libiberty</code>, and so on):
74 <pre class="example"> make -f Makefile.in gdb.tar.gz
75 </pre>
77 <p>This will properly configure, clean, rebuild any files that are
78 distributed pre-built (e.g. <code>c-exp.tab.c</code> or <code>refcard.ps</code>),
79 and will then make a tarfile. (If the top level directory has already
80 been configured, you can just do <code>make gdb.tar.gz</code> instead.)
82 <p>This procedure requires:
84 <ul>
86 <li>symbolic links;
88 <li><code>makeinfo</code> (texinfo2 level);
90 <li>TeX;
92 <li><code>dvips</code>;
94 <li><code>yacc</code> or <code>bison</code>.
95 </ul>
97 <small class="dots">...</small> and the usual slew of utilities (<code>sed</code>, <code>tar</code>, etc.).
99 <h4 class="subheading">TEMPORARY RELEASE PROCEDURE FOR DOCUMENTATION</h4>
101 <p><code>gdb.texinfo</code> is currently marked up using the texinfo-2 macros,
102 which are not yet a default for anything (but we have to start using
103 them sometime).
105 <p>For making paper, the only thing this implies is the right generation of
106 <code>texinfo.tex</code> needs to be included in the distribution.
108 <p>For making info files, however, rather than duplicating the texinfo2
109 distribution, generate <code>gdb-all.texinfo</code> locally, and include the
110 files <code>gdb.info*</code> in the distribution. Note the plural;
111 <code>makeinfo</code> will split the document into one overall file and five
112 or so included files.
114 </body></html>