Path: blob/main/cddl/contrib/opensolaris/tools/ctf/common/ctf_headers.h
39563 views
/*1* CDDL HEADER START2*3* The contents of this file are subject to the terms of the4* Common Development and Distribution License, Version 1.0 only5* (the "License"). You may not use this file except in compliance6* with the License.7*8* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE9* or http://www.opensolaris.org/os/licensing.10* See the License for the specific language governing permissions11* and limitations under the License.12*13* When distributing Covered Code, include this CDDL HEADER in each14* file and include the License file at usr/src/OPENSOLARIS.LICENSE.15* If applicable, add the following below this CDDL HEADER, with the16* fields enclosed by brackets "[]" replaced with your own identifying17* information: Portions Copyright [yyyy] [name of copyright owner]18*19* CDDL HEADER END20*/21/*22* Copyright 2003 Sun Microsystems, Inc. All rights reserved.23* Use is subject to license terms.24*/2526#ifndef _CTF_HEADERS_H27#define _CTF_HEADERS_H2829#pragma ident "%Z%%M% %I% %E% SMI"3031/*32* Because the ON tools are executed on the system where they are built,33* the tools need to include the headers installed on the build system,34* rather than those in the ON source tree. However, some of the headers35* required by the tools are part of the ON source tree, but not delivered36* as part of Solaris. These include the following:37*38* $(SRC)/lib/libctf/common/libctf.h39* $(SRC)/uts/common/sys/ctf_api.h40* $(SRC)/uts/common/sys/ctf.h41*42* These headers get installed in the proto area in the build environment43* under $(ROOT)/usr/include and $(ROOT)/usr/include/sys. Though these44* headers are not part of the release, in releases including and prior to45* 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 first47* in Makefile.ctf because we might actually get downlevel versions of the48* ctf headers. Depending on the order of the -I includes, we can also have49* a problem with mismatched headers when building the ctf tools with some50* headers getting pulled in from /usr/include and others from51* $(SRC)/uts/common/sys.52*53* To address the problem, we have done two things:54* 1) Created this header with a specific order of inclusion for the55* 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 in57* reverse order to guarantee that we get the correct versions of58* the headers.59* 2) In $(SRC)/tools/ctf/Makefile.ctf, we order the -I includes such60* that we first search the directories where the ctf headers61* live, followed by /usr/include, followed by $(SRC)/uts/common.62* This last -I include is needed in order to prevent a build failure63* when <sys/ctf_api.h> is included via a nested #include rather than64* an explicit path #include.65*/6667#include <sys/ctf.h>68#include <uts/common/sys/ctf_api.h>69#include <lib/libctf/common/libctf.h>7071#endif /* _CTF_HEADERS_H */727374