1N/A#
1N/A# Copyright (c) 2002, 2011, Oracle and/or its affiliates. All rights reserved.
1N/A#
1N/A
1N/A#
1N/A# Makefile.PL for ::Exacct::Catalog
1N/A#
1N/A
1N/A# See ../Makefile.PL for an explanation of the linker flag manipulations.
1N/A
1N/Arequire 5.8.4;
1N/Ause Config;
1N/Ause strict;
1N/Ause warnings;
1N/Ause ExtUtils::MakeMaker;
1N/A
1N/A#
1N/A# Some later versions of ExtUtils::MakeMaker are broken,
1N/A# and complain about function redefinitions in the child Makefile.PLs.
1N/A# Stop the warnings.
1N/A#
1N/Ano warnings qw(redefine);
1N/A
1N/Aour (@defines, @man3pods);
1N/A
1N/A#
1N/A# MakeMaker overrides.
1N/A#
1N/Apackage MY;
1N/Ano warnings qw(once);
1N/A
1N/A#
1N/A# Overrides that are common to both the ON and non-ON build environments.
1N/A#
1N/A
1N/A#
1N/A# Suppress the setting of LD_RUN_PATH, as it isn't necessary.
1N/A#
1N/A
1N/Asub const_loadlibs
1N/A{
1N/A my $self = shift(@_);
1N/A delete($self->{LD_RUN_PATH});
1N/A return($self->SUPER::const_loadlibs(@_));
1N/A}
1N/A
1N/Asub dynamic_lib
1N/A{
1N/A my $self = shift(@_);
1N/A my $txt = $self->SUPER::dynamic_lib(@_);
1N/A $txt =~ s/LD_RUN_PATH=\S*\s*//;
1N/A return($txt);
1N/A}
1N/A
1N/A#
1N/A# ON-specific overrides.
1N/A#
1N/Aif (exists($ENV{CODEMGR_WS}) && exists($ENV{ENVCPPFLAGS1})) {
1N/A #
1N/A # Override postamble and replace it with one that explicitly records
1N/A # the dependency between Catalog.c (generated from Catalog.xs by xsubpp)
1N/A # and the ObjectDefs.xi file (generated from sys/exacct_catalog.h by
1N/A # extract_defines). Note we have to mimic the -I processing done by cc
1N/A # to find the correct version of the file, as we want the copy from the
1N/A # proto area rather than /usr/include. This ensures that the constant
1N/A # values exported by the perl module stay up-to date with the
1N/A # corresponding #defines.
1N/A #
1N/A *postamble = sub {
1N/A return <<'EOF';
1N/AEXACCT_H:sh= \
1N/A for dir in $ENVCPPFLAGS1 $ENVCPPFLAGS2 $ENVCPPFLAGS3 $ENVCPPFLAGS4 \
1N/A /usr/include; do \
1N/A dir=`expr $dir : '^-I\(.*\)$' \| $dir`; \
1N/A file="$dir/sys/exacct_catalog.h"; \
1N/A test -f $file && echo $file && break; \
1N/A done;
1N/A
1N/ACatalog.c: CatalogDefs.xi
1N/A
1N/ACatalogDefs.xi: ../extract_defines $(EXACCT_H)
1N/A $(PERL) ../extract_defines Catalog $@ $(EXACCT_H)
1N/AEOF
1N/A };
1N/A
1N/A # Enable/disable debugging as required.
1N/A @main::defines = ( DEFINE => '-DEXACCT_DEBUG' )
1N/A if (! exists($ENV{RELEASE_BUILD}));
1N/A
1N/A # Don't install POD pages for ON.
1N/A @main::man3pods = ( MAN3PODS => {} );
1N/A
1N/A#
1N/A# Non-ON overrides.
1N/A#
1N/A} else {
1N/A #
1N/A # Override postamble and replace it with one that explicitly records
1N/A # the dependency between Catalog.c (generated from Catalog.xs by xsubpp)
1N/A # and the ObjectDefs.xi file (generated from
1N/A # /usr/include/sys/exacct_catalog.h by extract_defines). This ensures
1N/A # that the constant values exported by the perl module stay up-to date
1N/A # with the corresponding #defines.
1N/A #
1N/A *postamble = sub {
1N/A return <<'EOF';
1N/AEXACCT_H = /usr/include/sys/exacct_catalog.h
1N/A
1N/ACatalog.c: CatalogDefs.xi
1N/A
1N/ACatalogDefs.xi: ../extract_defines $(EXACCT_H)
1N/A $(PERL) ../extract_defines Catalog $@ $(EXACCT_H)
1N/AEOF
1N/A };
1N/A
1N/A # Install the POD documentation for non-ON builds.
1N/A my $man3pfx = '$(INST_MAN3DIR)/Sun::Solaris::Exacct';
1N/A @main::man3pods = (
1N/A MAN3PODS => { '../pod/Catalog.pod' =>
1N/A $man3pfx . '::Catalog.$(MAN3EXT)' }
1N/A );
1N/A}
1N/A
1N/A#
1N/A# Having set everything up, write the Makefile.
1N/A#
1N/Apackage main;
1N/A
1N/AWriteMakefile(
1N/A NAME => 'Sun::Solaris::Exacct::Catalog',
1N/A VERSION_FROM => 'Catalog.pm',
1N/A H => [ '../exacct_common.xh' ],
1N/A TYPEMAPS => [ '../typemap' ],
1N/A CCFLAGS => $Config{'ccflags'} . ' -erroff=E_ATTRIBUTE_UNKNOWN',
1N/A @defines,
1N/A @man3pods,
1N/A dynamic_lib => { OTHERLDFLAGS =>
1N/A '-h $(DLBASE).$(DLEXT) ' .
1N/A '-R\$$ORIGIN/.. $(INST_ARCHAUTODIR)/../Exacct.so'
1N/A },
1N/A realclean => { FILES => 'CatalogDefs.xi' },
1N/A);