comm: add -Wall
[unleashed.git] / usr / src / tools / README.tools
blob1a199d09714ef499f44861708628dc4234597f14
2 # CDDL HEADER START
4 # The contents of this file are subject to the terms of the
5 # Common Development and Distribution License (the "License").
6 # You may not use this file except in compliance with the License.
8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 # or http://www.opensolaris.org/os/licensing.
10 # See the License for the specific language governing permissions
11 # and limitations under the License.
13 # When distributing Covered Code, include this CDDL HEADER in each
14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 # If applicable, add the following below this CDDL HEADER, with the
16 # fields enclosed by brackets "[]" replaced with your own identifying
17 # information: Portions Copyright [yyyy] [name of copyright owner]
19 # CDDL HEADER END
22 # Copyright (c) 1999, 2010, Oracle and/or its affiliates. All rights reserved.
25 This directory contains the tools used to do a full build of the
26 OS/Net workspace.  They usually live in the /opt/onbld directory on build
27 machines. From here, 'make install' will build and install the tools
28 in $ROOT/opt/onbld.
30 Layout of /opt/onbld
31 --------------------
33 /opt/onbld/etc/abi
34         contains Solaris ABI database (ABI_*.db) and exceptions
35         for ABI Auditing tool (interface_check, interface_cmp).
37 /opt/onbld/bin
38         basic bin directory - contains scripts.
40 /opt/onbld/bin/${MACH}
41         architecture-specific bin directory for binaries.
43 /opt/onbld/env
44         build environment files.
46 /opt/onbld/lib
47         libraries used by the build tools.
49 /opt/onbld/lib/python<version>/
50         python modules used by the build tools.
52 /opt/onbld/lib/python/ 
53         symlink to the modules directory of the currently preferred
54         python version.
56 /opt/onbld/man
57         rudimentary man pages for some of the tools.
60 Tool Summary
61 ------------
63 bldenv
64         companion to 'nightly.' Takes the same environment file you
65         used with 'nightly,' and starts a shell with the environment
66         set up the same way as 'nightly' set it up. This is useful
67         if you're trying to quickly rebuild portions of a workspace
68         built by 'nightly'. 'ws' should not be used for this since it
69         sets the environment up differently and may cause everything
70         to rebuild (because of different -I or -L paths).
72 check_rtime
73         checks ELF attributes used by ELF dynamic objects in the proto area.
74         Used by 'nightly's -r option, to check a number of ELF runtime
75         attributes for consistency with common build rules.  nightly uses
76         the -o option to simplify the output for diffing with previous
77         build results.  It also uses the -i option to obtain NEEDED and RUNPATH
78         entries, which help detect changes in software dependencies and makes
79         sure objects don't have any strange runpaths like /opt/SUNWspro/lib.
81 codereview
82         Given two filenames, creates a postscript file with the file 
83         differences highlighted.
85 copyrightchk
86         Checks that files have appropriate SMI copyright notices.
87         Primarily used by wx
89 cstyle
90         checks C source for compliance with OS/Net guidelines.
92 ctfconvert
93         Convert symbolic debugging information in an object file to the Compact
94         ANSI-C Type Format (CTF).
96 ctfdump
97         Decode and display CTF data stored in a raw file or in an ELF file.
99 ctfmerge
100         Merge the CTF data from one or more object files.
102 elfcmp
103         Compares two ELF modules (e.g. .o files, executables) section by
104         section.  Useful for determining whether "trivial" changes -
105         cstyle, lint, etc - actually changed the code.  The -S option
106         is used to test whether two binaries are the same except for
107         the elfsign signature.
109 find_elf
110         Search a directory tree for ELF objects, and produce one line of
111         output per object. Used by check_rtime and interface_check to locate
112         the objects to examine.
114 hdrchk
115         checks headers for compliance with OS/Net standards (form, includes,
116         C++ guards).
118 interface_check
119         detects and reports invalid versioning in ELF objects.
120         Optionally generates an interface description file for
121         the workspace.
123 interface_cmp
124         Compares two interface description files, as produced by
125         interface_check, and flags invalid deviations in ELF object
126         versioning between them. interface_cmp can be used between Solaris
127         gates to ensure that older releases remain compatible with the
128         development gate. It can also be used to validate new changes to
129         the development gate before they are integrated.
131 ndrgen
132         Network Data Language (NDL) RPC protocol compiler to support DCE
133         RPC/MSRPC and SMB/CIFS.  ndrgen takes an input protocol definition
134         file (say, proto.ndl) and generates an output C source file
135         (proto_ndr.c) containing the Network Data Representation (NDR)
136         marshalling routines to implement the RPC protocol.
138 nightly
139         nightly build script. Takes an environment (or 'env') file describing
140         such things as the workspace, the parent, and what to build. See
141         env/developer and env/gatekeeper for sample, hopefully well-commented
142         env files.
144 protocmp
145         compares proto lists and the package definitions. Used by nightly
146         to determine if the proto area matches the packages, and to detect
147         differences between a childs proto area and a parents.
149 protocmp.terse
150         transforms the output of protocmp into something a bit more friendly
152 protolist
153         create a list of what's in the proto area, to feed to protocmp.
157         creates a shell with the environment set up to build in the given
158         workspace. Used mostly for non-full-build workspaces, so it sets up
159         to pull headers and libraries from the proto area of the parent if
160         they aren't in the childs proto area.
162 tokenize
163         Used to build the sun4u boot block.
165 webrev
166         Generates a set of HTML pages that show side-by-side diffs of
167         changes in your workspace, for easy communication of code
168         review materials.  Can automatically find edited files or use a
169         manually-generated list.
171 wsdiff
172         Detect object differences between two ON proto areas. Used by
173         nightly(1) to determine what changed between two builds. Handy
174         for identifying the set of built objects impacted by a given
175         source change. This information is needed for patch construction.
178 How to do a full build
179 ----------------------
181 1. Find an environment file that might do what you want to do. If you're just
182    a developer wanting to do a full build in a child of the gate, copy the
183    'developer' environment file to a new name (private to you and/or the
184    work being done in this workspace, to avoid collisions with others). Then
185    edit the file and tailor it to your workspace. Remember that this file
186    is a shell script, so it can do more than set environment variables.
188 2. Run 'nightly' and give it your environment file as an
189    option. 'nightly' will first look for your environment file in
190    /opt/onbld/env, and if it's not there then it will look for it as an
191    absolute or relative path. Some people put their environment files in
192    their workspace to keep them close.
194 3. When 'nightly' is complete, it will send a summary of what happened to
195    $MAILTO. Usually, the less info in the mail the better. If you have failures,
196    you can go look at the full log of what happened, generally in
197    $SRCTOP/log/log.<date>/nightly.log (the mail_msg it sent and the proto
198    list are there too). You can also find the individual build logs, like
199    'make clobber' and 'make install' output in $SRC, under names like
200    clobber-${MACH}.out and install-${MACH}.out (for a DEBUG build). These
201    will be smaller than nightly.log, and maybe more searchable.
203 Files you have to update to add a tool
204 --------------------------------------
206 1.  Add the tool in its appropriate place.
207 2.  Update the Makefile as required.
208 3.  Update usr/src/pkg/manifests/developer-build-onbld.mf
209 4.  Update usr/src/tools/README.tools (this file).
210 5.  Repeat 1-4 for any man pages.