source: rtems/doc/FAQ/tools.t @ cd0bab2

Last change on this file since cd0bab2 was cd0bab2, checked in by Joel Sherrill <joel.sherrill@…>, on 09/03/03 at 19:29:06

2003-09-03 Aaron J. Grier <aaron@…>

  • tools.t: Added how to generate and apply a patch.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1@c
2@c  COPYRIGHT (c) 1988-2002.
3@c  On-Line Applications Research Corporation (OAR).
4@c  All rights reserved.
5@c
6@c  $Id$
7@c
8
9@chapter General Development Tool Hints
10
11The questions in this category are related to the GNU development tools
12in a non-language specific way.
13
14@section What is GNU?
15
16Take a look at @uref{http://www.gnu.org,http://www.gnu.org} for information on the GNU Project.
17
18@section How do I generate a patch?
19
20The RTEMS patches to the development tools are generated using a
21command like this
22
23@example
24diff -N -P -r -c TOOL-original-image TOOL-with-changes >PATCHFILE
25@end example
26
27where the options are:
28
29@itemize @bullet
30
31@item -N and -P take care of adding and removing files (be careful not to
32include junk files like file.mybackup)
33
34@item -r tells diff to recurse through subdirectories
35
36@item -c is a context diff (easy to read for humans)
37
38@end itemize
39
40Please look at the generated PATCHFILE and make sure it does not
41contain anything you did not intend to send to the maintainers. 
42It is easy to accidentally leave a backup file in the modified
43source tree or have a spurious change that should not be
44in the PATCHFILE.
45
46If you end up with the entire contents of a file in the patch
47and can't figure out why, you may have different CR/LF scheme
48in the two source files.  The GNU open-source packages usually have
49UNIX style CR/LF.  If you edit on a Windows platform, the line
50terminators may have been transformed by the editor into Windows
51style.
52
53@section How do I apply a patch?
54
55Patches generated with the @code{diff} program are fed into the
56@code{patch} program as follows:
57
58@example
59patch -p1 <PATCHFILE
60@end example
61
62where the options are:
63
64@itemize @bullet
65
66@item -pNUM tells @code{patch} to strip off NUM slashes from the
67pathname.
68
69@end itemize
70
71If @code{patch} prompts for a file to patch, you may need to adjust NUM.
Note: See TracBrowser for help on using the repository browser.