xref: /onnv-gate/usr/src/cmd/perl/contrib/Sun/Solaris/Kstat/Makefile.PL (revision 5084:7d838c5c0eed)
11341Sstevel#
21341Sstevel# CDDL HEADER START
31341Sstevel#
41341Sstevel# The contents of this file are subject to the terms of the
51410Salanbur# Common Development and Distribution License (the "License").
61410Salanbur# You may not use this file except in compliance with the License.
71341Sstevel#
81341Sstevel# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
91341Sstevel# or http://www.opensolaris.org/os/licensing.
101341Sstevel# See the License for the specific language governing permissions
111341Sstevel# and limitations under the License.
121341Sstevel#
131341Sstevel# When distributing Covered Code, include this CDDL HEADER in each
141341Sstevel# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
151341Sstevel# If applicable, add the following below this CDDL HEADER, with the
161341Sstevel# fields enclosed by brackets "[]" replaced with your own identifying
171341Sstevel# information: Portions Copyright [yyyy] [name of copyright owner]
181341Sstevel#
191341Sstevel# CDDL HEADER END
201341Sstevel#
211410Salanbur
221341Sstevel#
23*5084Sjohnlev# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
241341Sstevel# Use is subject to license terms.
251341Sstevel#
261410Salanbur# ident	"%Z%%M%	%I%	%E% SMI"
271341Sstevel#
281341Sstevel
291341Ssteveluse ExtUtils::MakeMaker;
301410Salanburmy ($defines, $includes) = ('', '');
311341Sstevel
321410Salanbur# Uncomment this to turn on assertions
331410Salanbur#$defines .= '-DKSTAT_DEBUG ';
341410Salanbur
351410Salanbur# Uncomment this to report unknown binary kstats
361410Salanbur#$defines .= '-DREPORT_UNKNOWN ';
371341Sstevel
381341Sstevel#
391341Sstevel# Because there are still platform specific raw kstats, we need to include the
401341Sstevel# platform specific header files, so work out where they live.
411341Sstevel#
421410Salanburmy $arch = qx{uname -p}; chomp($arch);
431410Salanburif ($arch eq 'sparc') {
441410Salanbur	$includes .= '-I/usr/platform/sun4u/include' .
451410Salanbur	    ' -I/usr/platform/sun4v/include';
461410Salanbur} elsif ($arch eq 'i386') {
471410Salanbur	$includes .= '-I/usr/platform/i86pc/include' .
48*5084Sjohnlev	    ' -I/usr/platform/i86xpv/include';
491410Salanbur} else {
501410Salanbur	die("Unknown architecture $arch\n");
511410Salanbur}
521341Sstevel
531341SstevelWriteMakefile(
541341Sstevel    NAME         => 'Sun::Solaris::Kstat',
551341Sstevel    VERSION_FROM => 'Kstat.pm',
561341Sstevel    LIBS         => [ '-lkstat' ],
571410Salanbur    DEFINE       => $defines,
581410Salanbur    INC          => $includes,
591341Sstevel    OBJECT       => '$(O_FILES)',
601341Sstevel);
61