Home | History | Annotate | Download | only in Kstat
      1  1341   stevel #
      2  1341   stevel # CDDL HEADER START
      3  1341   stevel #
      4  1341   stevel # The contents of this file are subject to the terms of the
      5  1410  alanbur # Common Development and Distribution License (the "License").
      6  1410  alanbur # You may not use this file except in compliance with the License.
      7  1341   stevel #
      8  1341   stevel # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  1341   stevel # or http://www.opensolaris.org/os/licensing.
     10  1341   stevel # See the License for the specific language governing permissions
     11  1341   stevel # and limitations under the License.
     12  1341   stevel #
     13  1341   stevel # When distributing Covered Code, include this CDDL HEADER in each
     14  1341   stevel # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  1341   stevel # If applicable, add the following below this CDDL HEADER, with the
     16  1341   stevel # fields enclosed by brackets "[]" replaced with your own identifying
     17  1341   stevel # information: Portions Copyright [yyyy] [name of copyright owner]
     18  1341   stevel #
     19  1341   stevel # CDDL HEADER END
     20  1341   stevel #
     21  1410  alanbur 
     22  1341   stevel #
     23  5084  johnlev # Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     24  1341   stevel # Use is subject to license terms.
     25  1341   stevel #
     26  1410  alanbur # ident	"%Z%%M%	%I%	%E% SMI"
     27  1341   stevel #
     28  1341   stevel 
     29  1341   stevel use ExtUtils::MakeMaker;
     30  1410  alanbur my ($defines, $includes) = ('', '');
     31  1341   stevel 
     32  1410  alanbur # Uncomment this to turn on assertions
     33  1410  alanbur #$defines .= '-DKSTAT_DEBUG ';
     34  1410  alanbur 
     35  1410  alanbur # Uncomment this to report unknown binary kstats
     36  1410  alanbur #$defines .= '-DREPORT_UNKNOWN ';
     37  1341   stevel 
     38  1341   stevel #
     39  1341   stevel # Because there are still platform specific raw kstats, we need to include the
     40  1341   stevel # platform specific header files, so work out where they live.
     41  1341   stevel #
     42  1410  alanbur my $arch = qx{uname -p}; chomp($arch);
     43  1410  alanbur if ($arch eq 'sparc') {
     44  1410  alanbur 	$includes .= '-I/usr/platform/sun4u/include' .
     45  1410  alanbur 	    ' -I/usr/platform/sun4v/include';
     46  1410  alanbur } elsif ($arch eq 'i386') {
     47  1410  alanbur 	$includes .= '-I/usr/platform/i86pc/include' .
     48  5084  johnlev 	    ' -I/usr/platform/i86xpv/include';
     49  1410  alanbur } else {
     50  1410  alanbur 	die("Unknown architecture $arch\n");
     51  1410  alanbur }
     52  1341   stevel 
     53  1341   stevel WriteMakefile(
     54  1341   stevel     NAME         => 'Sun::Solaris::Kstat',
     55  1341   stevel     VERSION_FROM => 'Kstat.pm',
     56  1341   stevel     LIBS         => [ '-lkstat' ],
     57  1410  alanbur     DEFINE       => $defines,
     58  1410  alanbur     INC          => $includes,
     59  1341   stevel     OBJECT       => '$(O_FILES)',
     60  1341   stevel );
     61