xref: /onnv-gate/usr/src/cmd/perl/contrib/Sun/Solaris/Lgrp/Makefile.PL (revision 8287:771477e4b843)
12685Sakolb#
22685Sakolb# CDDL HEADER START
32685Sakolb#
42685Sakolb# The contents of this file are subject to the terms of the
52685Sakolb# Common Development and Distribution License (the "License").
62685Sakolb# You may not use this file except in compliance with the License.
72685Sakolb#
82685Sakolb# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
92685Sakolb# or http://www.opensolaris.org/os/licensing.
102685Sakolb# See the License for the specific language governing permissions
112685Sakolb# and limitations under the License.
122685Sakolb#
132685Sakolb# When distributing Covered Code, include this CDDL HEADER in each
142685Sakolb# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
152685Sakolb# If applicable, add the following below this CDDL HEADER, with the
162685Sakolb# fields enclosed by brackets "[]" replaced with your own identifying
172685Sakolb# information: Portions Copyright [yyyy] [name of copyright owner]
182685Sakolb#
192685Sakolb# CDDL HEADER END
202685Sakolb#
212685Sakolb
222685Sakolb#
23*8287SJohn.Sonnenschein@Sun.COM# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
242685Sakolb# Use is subject to license terms.
252685Sakolb#
262685Sakolb
27*8287SJohn.Sonnenschein@Sun.COMrequire 5.8.4;
282685Sakolbuse strict;
292685Sakolbuse warnings;
302685Sakolbuse ExtUtils::MakeMaker;
312685Sakolb
322685Sakolb# #defines.
332685Sakolbmy @defines = ( DEFINE => exists($ENV{RELEASE_BUILD}) ? '-DNDEBUG' : '' );
342685Sakolb
352685Sakolb# List of POD pages to install.
362685Sakolbmy @man3pods = ( MAN3PODS => {} );
372685Sakolb
382685Sakolb
392685Sakolb#
402685Sakolb# If not building as part of ON.
412685Sakolb#
422685Sakolbif (! exists($ENV{CODEMGR_WS})) {
432685Sakolb
442685Sakolb	#
452685Sakolb	# Suppress the setting of LD_RUN_PATH.  The ON build environment
462685Sakolb	# contains a modified MakeMaker that does this automatically, so we
472685Sakolb	# only need to do this if we are building outside of ON.
482685Sakolb	#
492685Sakolb	package MY;
502685Sakolb	no warnings qw(once);
512685Sakolb
522685Sakolb	# Override const_loadlibs to remove LD_RUN_PATH cruft.
532685Sakolb	*const_loadlibs = sub
542685Sakolb	{
552685Sakolb		my $self = shift(@_);
562685Sakolb		delete($self->{LD_RUN_PATH});
572685Sakolb		return($self->SUPER::const_loadlibs(@_));
582685Sakolb	};
592685Sakolb
602685Sakolb	# Override dynamic_lib to get rid of LD_RUN_PATH cruft.
612685Sakolb	*dynamic_lib = sub
622685Sakolb	{
632685Sakolb		my $self = shift(@_);
642685Sakolb		my $txt = $self->SUPER::dynamic_lib(@_);
652685Sakolb		$txt =~ s/LD_RUN_PATH=\S*\s*//;
662685Sakolb		return($txt);
672685Sakolb	};
682685Sakolb
692685Sakolb	# Turn off debugging.
702685Sakolb	@defines = ();
712685Sakolb
722685Sakolb	#
732685Sakolb	# Install the POD documentation for non-ON builds.
742685Sakolb	#
752685Sakolb	my $man3pfx = '$(INST_MAN3DIR)/Sun::Solaris::Lgrp';
762685Sakolb	@man3pods = (
772685Sakolb	    MAN3PODS => { 'pod/Lgrp.pod' => $man3pfx . '.$(MAN3EXT)' }
782685Sakolb	);
792685Sakolb}
802685Sakolb
812685SakolbWriteMakefile(
822685Sakolb    NAME              => 'Sun::Solaris::Lgrp',
832685Sakolb    VERSION_FROM      => 'Lgrp.pm',
842685Sakolb    LIBS              => ['-llgrp '],
852685Sakolb    @defines,
862685Sakolb    @man3pods,
872685Sakolb);
88