MM_Solaris_ON.pm revision 7c478bd95313f5f23a4c958a745db2134aa03244
#
# Copyright 2004 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
#ident "%Z%%M% %I% %E% SMI"
#
# MM_Solaris_ON.pm overrides various parts of MakeMaker so that perl modules
# 1. parse_args is overriden to merge the values of DEFINE specified in
# Makefile.PL and on the command line. The default behaviour is that
# the command line value overwrites any value specified in Makefile.PL.
# 2. constants() is overriden to add the incluide paths specified in the
# ENVCPPFLAGS[1-n] environment variables to the compiler command-line so
# that the compiler looks in the proto area for include files.
# 3. ext() is overriden to add the library paths specified in the
# ENVLDLIBS[1-n] environment variables to the linker command-line so
# that the linker looks in the proto area for libraries.
#
# Plug into Makemaker - see ExtUtils::MM_*.pm
package ExtUtils::MM_Solaris_ON;
use strict;
use warnings;
$VERSION = '1.1';
#
# The default MakeMaker parse_args function overwrites DEFINE values passed
# to WriteMakefile with the values specified on the command line, which is
# obviously broken. This overrides the default implementation and merges the
# WriteMakefile and command line versions. See ExtUtils::MakeMaker.pm for
# details of the parse_args() method. Because parse_args isn't an overrideable
# MakeMaker method, we have to pull some dirty tricks with the MakeMaker stash
# to make this work.
#
our $real_parse_args;
BEGIN {
no warnings qw(redefine);
}
sub parse_args
{
}
#
# The constants() method works out the compiler flags needed to build a module.
# Override it to take into account the current settings of the ENVCPPFLAGS[1-n]
# ExtUtils::MM_Unix for details of the constants() method.
#
sub constants
{
my ($self) = @_;
# Find all the ENVCPPFLAGS[1-n] environment variables
keys(%ENV))) {
# Ignore everything except '-I' flags.
next unless ($ip =~ s!^-I(.*)$!$1!);
# Add to newincs if not seen before.
#
# If the path points to somewhere under a proto area,
# figure out the top of the proto area & save for later.
#
}
# Search INC string, prepending the proto areas to any absolute paths.
# Deal with -I flags
if (my ($p) = $_ =~ /^-I(.*)$/) {
# Only prepend to absolute paths
if ($self->file_name_is_absolute($p)) {
my $ppp = "$pp$p";
push(@newincs, "-I$ppp")
}
# Pass relative paths through.
} else {
}
# Pass anything else through.
} else {
push(@newincs, $_);
}
}
# Call the default Unix constants() method (see MM_Unix.pm)
}
#
# The ext() method works out the linker flags required to build a module.
# Override it to take into account the current settings of the ENVLDLIBS[1-n]
# LD_RUN_PATH that is returned by the default implementation, as it is not
# details of the ext() method.
#
sub ext
{
# Find all the ENVLDLIBS[1-n] environment variables
keys(%ENV))) {
# Ignore everything except '-L' flags
next unless ($lp =~ s!^-L(.*)$!$1!);
# Add to lib_prefix if not seen before
#
# If the path points to somewhere under a proto area,
# figure out the top of the proto area & save for later
#
}
# Search libs string, prepending the proto areas to any absolute paths
%lib_seen = ();
foreach (split(' ', $libs)) {
# Deal with -L flags
if (my ($p) = $_ =~ /^-L(.*)$/) {
# Only prepend to absolute paths
if ($self->file_name_is_absolute($p)) {
my $ppp = "$pp$p";
push(@newlibs, "-L$ppp")
}
# Pass relative paths through
} else {
}
# Pass anything else through
} else {
push(@newlibs, $_);
}
}
# Call the default Unix ext() method (see Liblist.pm)
$verbose, $need_names);
#
# Prepend any missing members of @lib_prefix onto LDLOADLIBS.
# Do this after calling ext() as ext() will strip out all the -L flags
# if passed an empty library list. Note we don't touch EXTRALIBS as
# it is only used to create the extralibs.ld file, and we don't want
# the ON environment leaking out into shipped files.
#
$prefix .= ' ';
# By default any directories containing libraries are returned as part
# as it results in the proto area being stored in RPATH in the resulting
# perl module.so files, so we null it out here.
#
return (@retval);
}
1;