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. pasthru() is overriden to pass down values of INC and DEFINES to child
# Makefile.PLs, otherwise only top-level module Makefile.PLs will be
# affected by such flags. This could be construed as a bug in perl,
# but fixing it causes breakage in commonly used perl modules (e.g. Tk).
# 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.
#
# Magic needed to plug into Makemaker - see ExtUtils::MM*.pm
package ExtUtils::MM_Solaris_ON;
require Exporter;
#
# The pasthru() method works out which macros need to be passed to child makes.
# In addition to the default list of values, pass through DEFINE and INC as
# well. See ExtUtils::MM_Unix for details of the pasthru() method.
#
sub pasthru
{
my ($self) = shift;
my (@pasthru);
push(@pasthru, "$_=\"\$($_)\"");
}
}
#
# 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);
}