dmake: do not set MAKEFLAGS=k
[unleashed/tickless.git] / usr / src / tools / ctf / common / ctf_headers.h
blobd696c3ce5896d54e55acc3301c010a51be1ecd01
1 /*
2 * CDDL HEADER START
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License"). You may not use this file except in compliance
7 * with the License.
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
20 * CDDL HEADER END
23 * Copyright 2003 Sun Microsystems, Inc. All rights reserved.
24 * Use is subject to license terms.
27 #ifndef _CTF_HEADERS_H
28 #define _CTF_HEADERS_H
31 * Because the ON tools are executed on the system where they are built,
32 * the tools need to include the headers installed on the build system,
33 * rather than those in the ON source tree. However, some of the headers
34 * required by the tools are part of the ON source tree, but not delivered
35 * as part of Solaris. These include the following:
37 * $(SRC)/lib/libctf/common/libctf.h
38 * $(SRC)/lib/libctf/common/libctf_impl.h
39 * include/sys/ctf_api.h
40 * include/sys/ctf.h
42 * These headers get installed in the proto area in the build environment
43 * under $(ROOT)/usr/include and $(ROOT)/usr/include/sys. Though these
44 * headers are not part of the release, in releases including and prior to
45 * Solaris 9, they did get installed on the build system via bfu. Therefore,
46 * we can not simply force the order of inclusion with -I/usr/include first
47 * in Makefile.ctf because we might actually get downlevel versions of the
48 * ctf headers. Depending on the order of the -I includes, we can also have
49 * a problem with mismatched headers when building the ctf tools with some
50 * headers getting pulled in from /usr/include and others from
51 * include/sys.
53 * To address the problem, we have done two things:
54 * 1) Created this header with a specific order of inclusion for the
55 * ctf headers. Because the <libctf.h> header includes <sys/ctf_api.h>
56 * which in turn includes <sys/ctf.h> we need to include these in
57 * reverse order to guarantee that we get the correct versions of
58 * the headers.
59 * 2) In $(SRC)/tools/ctf/Makefile.ctf, we order the -I includes such
60 * that we first search the directories where the ctf headers
61 * live, followed by /usr/include, followed by include. This last -I
62 * include is needed in order to prevent a build failure when
63 * <sys/ctf_api.h> is included via a nested #include rather than an
64 * explicit path #include.
67 #include <sys/ctf.h>
68 #include <sys/ctf_api.h>
69 #include <common/ctf/ctf_impl.h>
70 #include <lib/libctf/common/libctf.h>
71 #include <lib/libctf/common/libctf_impl.h>
73 #endif /* _CTF_HEADERS_H */