1178481Sjb/* 2178481Sjb * CDDL HEADER START 3178481Sjb * 4178481Sjb * The contents of this file are subject to the terms of the 5178481Sjb * Common Development and Distribution License, Version 1.0 only 6178481Sjb * (the "License"). You may not use this file except in compliance 7178481Sjb * with the License. 8178481Sjb * 9178481Sjb * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10178481Sjb * or http://www.opensolaris.org/os/licensing. 11178481Sjb * See the License for the specific language governing permissions 12178481Sjb * and limitations under the License. 13178481Sjb * 14178481Sjb * When distributing Covered Code, include this CDDL HEADER in each 15178481Sjb * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16178481Sjb * If applicable, add the following below this CDDL HEADER, with the 17178481Sjb * fields enclosed by brackets "[]" replaced with your own identifying 18178481Sjb * information: Portions Copyright [yyyy] [name of copyright owner] 19178481Sjb * 20178481Sjb * CDDL HEADER END 21178481Sjb */ 22178481Sjb/* 23178481Sjb * Copyright 2003 Sun Microsystems, Inc. All rights reserved. 24178481Sjb * Use is subject to license terms. 25178481Sjb */ 26178481Sjb 27178481Sjb#ifndef _CTF_HEADERS_H 28178481Sjb#define _CTF_HEADERS_H 29178481Sjb 30178481Sjb#pragma ident "%Z%%M% %I% %E% SMI" 31178481Sjb 32178481Sjb/* 33178481Sjb * Because the ON tools are executed on the system where they are built, 34178481Sjb * the tools need to include the headers installed on the build system, 35178481Sjb * rather than those in the ON source tree. However, some of the headers 36178481Sjb * required by the tools are part of the ON source tree, but not delivered 37178481Sjb * as part of Solaris. These include the following: 38178481Sjb * 39178481Sjb * $(SRC)/lib/libctf/common/libctf.h 40178481Sjb * $(SRC)/uts/common/sys/ctf_api.h 41178481Sjb * $(SRC)/uts/common/sys/ctf.h 42178481Sjb * 43178481Sjb * These headers get installed in the proto area in the build environment 44178481Sjb * under $(ROOT)/usr/include and $(ROOT)/usr/include/sys. Though these 45178481Sjb * headers are not part of the release, in releases including and prior to 46178481Sjb * Solaris 9, they did get installed on the build system via bfu. Therefore, 47178481Sjb * we can not simply force the order of inclusion with -I/usr/include first 48178481Sjb * in Makefile.ctf because we might actually get downlevel versions of the 49178481Sjb * ctf headers. Depending on the order of the -I includes, we can also have 50178481Sjb * a problem with mismatched headers when building the ctf tools with some 51178481Sjb * headers getting pulled in from /usr/include and others from 52178481Sjb * $(SRC)/uts/common/sys. 53178481Sjb * 54178481Sjb * To address the problem, we have done two things: 55178481Sjb * 1) Created this header with a specific order of inclusion for the 56178481Sjb * ctf headers. Because the <libctf.h> header includes <sys/ctf_api.h> 57178481Sjb * which in turn includes <sys/ctf.h> we need to include these in 58178481Sjb * reverse order to guarantee that we get the correct versions of 59178481Sjb * the headers. 60178481Sjb * 2) In $(SRC)/tools/ctf/Makefile.ctf, we order the -I includes such 61178481Sjb * that we first search the directories where the ctf headers 62178481Sjb * live, followed by /usr/include, followed by $(SRC)/uts/common. 63178481Sjb * This last -I include is needed in order to prevent a build failure 64178481Sjb * when <sys/ctf_api.h> is included via a nested #include rather than 65178481Sjb * an explicit path #include. 66178481Sjb */ 67178481Sjb 68178481Sjb#include <uts/common/sys/ctf.h> 69178481Sjb#include <uts/common/sys/ctf_api.h> 70178481Sjb#include <lib/libctf/common/libctf.h> 71178481Sjb 72178481Sjb#endif /* _CTF_HEADERS_H */ 73