=====================================================================
--ditto--
---------------------------------------------------------------------
New file: src/cddl/lib/libdtrace/Makefile
---------------------------------------------------------------------
# $FreeBSD$

.include	"../../Makefile.inc"

LIB=		dtrace
SHLIB_MAJOR=	1

WARNS=		1

SRCS=		dt_aggregate.c \
		dt_as.c \
		dt_buf.c \
		dt_cc.c \
		dt_cg.c \
		dt_consume.c \
		dt_decl.c \
		dt_dis.c \
		dt_dof.c \
		dt_error.c \
		dt_errtags.c \
		dt_grammar.y \
		dt_handle.c \
		dt_ident.c \
		dt_inttab.c \
		dt_lex.l \
		dt_link.c \
		dt_list.c \
		dt_map.c \
		dt_module.c \
		dt_names.c \
		dt_open.c \
		dt_options.c \
		dt_parser.c \
		dt_pcb.c \
		dt_pid.c \
		dt_pragma.c \
		dt_printf.c \
		dt_proc.c \
		dt_program.c \
		dt_provider.c \
		dt_regset.c \
		dt_string.c \
		dt_strtab.c \
		dt_subr.c \
		dt_work.c \
		dt_xlator.c \
		gmatch.c

DSRCS=		errno.d			\
		psinfo.d		\
		signal.d		\
		unistd.d

.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common
.PATH:		${OPENSOLARIS_USR_DISTDIR}/lib/libgen/common

CFLAGS+=	-I${.OBJDIR} \
		-I${.CURDIR}/../../../sys/cddl/compat/opensolaris \
		-I${.CURDIR}/../../../cddl/compat/opensolaris/include \
		-I${OPENSOLARIS_USR_DISTDIR}/head \
		-I${OPENSOLARIS_USR_DISTDIR}/lib/libctf/common \
		-I${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common \
		-I${OPENSOLARIS_SYS_DISTDIR}/uts/common

#CFLAGS+=	-DYYDEBUG

.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64"
CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
.elif ${MACHINE_ARCH} == "sparc64"
CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/sparc
.else
# temporary hack
CFLAGS+=	-I${OPENSOLARIS_SYS_DISTDIR}/uts/intel
.endif

LFLAGS+=-l

YFLAGS+=-d

CLEANFILES=	dt_errtags.c dt_names.c

dt_errtags.c:
	sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mkerrtags.sh < ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/dt_errtags.h > dt_errtags.c

dt_names.c:
	sh ${OPENSOLARIS_USR_DISTDIR}/lib/libdtrace/common/mknames.sh < ${OPENSOLARIS_SYS_DISTDIR}/uts/common/sys/dtrace.h > dt_names.c

beforedepend:	dt_errtags.c dt_names.c

beforeinstall:
.if exists(${DESTDIR}/usr/lib/dtrace)
.for file in ${DSRCS}
	${INSTALL} -o ${BINOWN} -g ${BINGRP} -m ${NOBINMODE} ${.CURDIR}/${file} ${DESTDIR}/usr/lib/dtrace
.endfor
.endif

.include <bsd.lib.mk>
=====================================================================
--ditto--
---------------------------------------------------------------------
New file: src/cddl/lib/libdtrace/signal.d
---------------------------------------------------------------------
/*
 * CDDL HEADER START
 *
 * The contents of this file are subject to the terms of the
 * Common Development and Distribution License, Version 1.0 only
 * (the "License").  You may not use this file except in compliance
 * with the License.
 *
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 * or http://www.opensolaris.org/os/licensing.
 * See the License for the specific language governing permissions
 * and limitations under the License.
 *
 * When distributing Covered Code, include this CDDL HEADER in each
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 * If applicable, add the following below this CDDL HEADER, with the
 * fields enclosed by brackets "[]" replaced with your own identifying
 * information: Portions Copyright [yyyy] [name of copyright owner]
 *
 * CDDL HEADER END
 *
 * Portions Copyright 2008 John Birrell jb@freebsd.org
 *
 * $FreeBSD$
 */

inline int SIGHUP = 1;
#pragma D binding "1.0" SIGHUP
inline int SIGINT = 2;
#pragma D binding "1.0" SIGINT
inline int SIGQUIT = 3;
#pragma D binding "1.0" SIGQUIT
inline int SIGILL = 4;
#pragma D binding "1.0" SIGILL
inline int SIGTRAP = 5;
#pragma D binding "1.0" SIGTRAP
inline int SIGABRT = 6;
#pragma D binding "1.0" SIGABRT
inline int SIGEMT = 7;
#pragma D binding "1.0" SIGEMT
inline int SIGFPE = 8;
#pragma D binding "1.0" SIGFPE
inline int SIGKILL = 9;
#pragma D binding "1.0" SIGKILL
inline int SIGBUS = 10;
#pragma D binding "1.0" SIGBUS
inline int SIGSEGV = 11;
#pragma D binding "1.0" SIGSEGV
inline int SIGSYS = 12;
#pragma D binding "1.0" SIGSYS
inline int SIGPIPE = 13;
#pragma D binding "1.0" SIGPIPE
inline int SIGALRM = 14;
#pragma D binding "1.0" SIGALRM
inline int SIGTERM = 15;
#pragma D binding "1.0" SIGTERM
inline int SIGURG = 16;
#pragma D binding "1.0" SIGURG
inline int SIGSTOP = 17;
#pragma D binding "1.0" SIGSTOP
inline int SIGTSTP = 18;
#pragma D binding "1.0" SIGTSTP
inline int SIGCONT = 19;
#pragma D binding "1.0" SIGCONT
inline int SIGCHLD = 20;
#pragma D binding "1.0" SIGCHLD
inline int SIGTTIN = 21;
#pragma D binding "1.0" SIGTTIN
inline int SIGTTOU = 22;
#pragma D binding "1.0" SIGTTOU
inline int SIGIO = 23;
#pragma D binding "1.0" SIGIO
inline int SIGXCPU = 24;
#pragma D binding "1.0" SIGXCPU
inline int SIGXFSZ = 25;
#pragma D binding "1.0" SIGXFSZ
inline int SIGVTALRM = 26;
#pragma D binding "1.0" SIGVTALRM
inline int SIGPROF = 27;
#pragma D binding "1.0" SIGPROF
inline int SIGWINCH = 28;
#pragma D binding "1.0" SIGWINCH
inline int SIGINFO = 29;
#pragma D binding "1.0" SIGINFO
inline int SIGUSR1 = 30;
#pragma D binding "1.0" SIGUSR1
inline int SIGUSR2 = 31;
#pragma D binding "1.0" SIGUSR2

inline int CLD_EXITED = 1;
#pragma D binding "1.0" CLD_EXITED
inline int CLD_KILLED = 2;
#pragma D binding "1.0" CLD_KILLED
inline int CLD_DUMPED = 3;
#pragma D binding "1.0" CLD_DUMPED
inline int CLD_TRAPPED = 4;
#pragma D binding "1.0" CLD_TRAPPED
inline int CLD_STOPPED = 5;
#pragma D binding "1.0" CLD_STOPPED
inline int CLD_CONTINUED = 6;
#pragma D binding "1.0" CLD_CONTINUED
