xref: /freebsd-src/cddl/contrib/opensolaris/tools/ctf/common/ctf_headers.h (revision 2d5d2a986ce1a93b8567dbdf3f80bc2b545d6998)
11673e404SJohn Birrell /*
21673e404SJohn Birrell  * CDDL HEADER START
31673e404SJohn Birrell  *
41673e404SJohn Birrell  * The contents of this file are subject to the terms of the
51673e404SJohn Birrell  * Common Development and Distribution License, Version 1.0 only
61673e404SJohn Birrell  * (the "License").  You may not use this file except in compliance
71673e404SJohn Birrell  * with the License.
81673e404SJohn Birrell  *
91673e404SJohn Birrell  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
101673e404SJohn Birrell  * or http://www.opensolaris.org/os/licensing.
111673e404SJohn Birrell  * See the License for the specific language governing permissions
121673e404SJohn Birrell  * and limitations under the License.
131673e404SJohn Birrell  *
141673e404SJohn Birrell  * When distributing Covered Code, include this CDDL HEADER in each
151673e404SJohn Birrell  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
161673e404SJohn Birrell  * If applicable, add the following below this CDDL HEADER, with the
171673e404SJohn Birrell  * fields enclosed by brackets "[]" replaced with your own identifying
181673e404SJohn Birrell  * information: Portions Copyright [yyyy] [name of copyright owner]
191673e404SJohn Birrell  *
201673e404SJohn Birrell  * CDDL HEADER END
211673e404SJohn Birrell  */
221673e404SJohn Birrell /*
231673e404SJohn Birrell  * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
241673e404SJohn Birrell  * Use is subject to license terms.
251673e404SJohn Birrell  */
261673e404SJohn Birrell 
271673e404SJohn Birrell #ifndef _CTF_HEADERS_H
281673e404SJohn Birrell #define	_CTF_HEADERS_H
291673e404SJohn Birrell 
301673e404SJohn Birrell #pragma ident	"%Z%%M%	%I%	%E% SMI"
311673e404SJohn Birrell 
321673e404SJohn Birrell /*
331673e404SJohn Birrell  * Because the ON tools are executed on the system where they are built,
341673e404SJohn Birrell  * the tools need to include the headers installed on the build system,
351673e404SJohn Birrell  * rather than those in the ON source tree. However, some of the headers
361673e404SJohn Birrell  * required by the tools are part of the ON source tree, but not delivered
371673e404SJohn Birrell  * as part of Solaris.  These include the following:
381673e404SJohn Birrell  *
391673e404SJohn Birrell  * $(SRC)/lib/libctf/common/libctf.h
401673e404SJohn Birrell  * $(SRC)/uts/common/sys/ctf_api.h
411673e404SJohn Birrell  * $(SRC)/uts/common/sys/ctf.h
421673e404SJohn Birrell  *
431673e404SJohn Birrell  * These headers get installed in the proto area in the build environment
441673e404SJohn Birrell  * under $(ROOT)/usr/include and $(ROOT)/usr/include/sys. Though these
451673e404SJohn Birrell  * headers are not part of the release, in releases including and prior to
461673e404SJohn Birrell  * Solaris 9, they did get installed on the build system via bfu. Therefore,
471673e404SJohn Birrell  * we can not simply force the order of inclusion with -I/usr/include first
481673e404SJohn Birrell  * in Makefile.ctf because we might actually get downlevel versions of the
491673e404SJohn Birrell  * ctf headers. Depending on the order of the -I includes, we can also have
501673e404SJohn Birrell  * a problem with mismatched headers when building the ctf tools with some
511673e404SJohn Birrell  * headers getting pulled in from /usr/include and others from
521673e404SJohn Birrell  * $(SRC)/uts/common/sys.
531673e404SJohn Birrell  *
541673e404SJohn Birrell  * To address the problem, we have done two things:
551673e404SJohn Birrell  * 1) Created this header with a specific order of inclusion for the
561673e404SJohn Birrell  *    ctf headers.  Because the <libctf.h> header includes <sys/ctf_api.h>
571673e404SJohn Birrell  *    which in turn includes <sys/ctf.h> we need to include these in
581673e404SJohn Birrell  *    reverse order to guarantee that we get the correct versions of
591673e404SJohn Birrell  *    the headers.
601673e404SJohn Birrell  * 2) In $(SRC)/tools/ctf/Makefile.ctf, we order the -I includes such
611673e404SJohn Birrell  *    that we first search the directories where the ctf headers
621673e404SJohn Birrell  *    live, followed by /usr/include, followed by $(SRC)/uts/common.
631673e404SJohn Birrell  *    This last -I include is needed in order to prevent a build failure
641673e404SJohn Birrell  *    when <sys/ctf_api.h> is included via a nested #include rather than
651673e404SJohn Birrell  *    an explicit path #include.
661673e404SJohn Birrell  */
671673e404SJohn Birrell 
68*2d5d2a98SMark Johnston #include <sys/ctf.h>
691673e404SJohn Birrell #include <uts/common/sys/ctf_api.h>
701673e404SJohn Birrell #include <lib/libctf/common/libctf.h>
711673e404SJohn Birrell 
721673e404SJohn Birrell #endif /* _CTF_HEADERS_H */
73