view release on metacpan or search on metacpan
4. Limitations and Disclaimers.
a. No trademark or patent rights held by Affirmer are waived, abandoned,
surrendered, licensed or otherwise affected by this document.
b. Affirmer offers the Work as-is and makes no representations or
warranties of any kind concerning the Work, express, implied, statutory
or otherwise, including without limitation warranties of title,
merchantability, fitness for a particular purpose, non infringement, or
the absence of latent or other defects, accuracy, or the present or
absence of errors, whether or not discoverable, all to the greatest
extent permissible under applicable law.
c. Affirmer disclaims responsibility for clearing rights of other persons
that may apply to the Work or any use thereof, including without
limitation any person's Copyright and Related Rights in the Work.
Further, Affirmer disclaims responsibility for obtaining any necessary
consents, permissions or other rights required for any use of the Work.
d. Affirmer understands and acknowledges that Creative Commons is not a
party to this document and has no duty or obligation with respect to
inc/Inline.pm view on Meta::CPAN
);
@config = $o->check_config(@config);
$o->fold_options;
$o->check_installed;
$o->env_untaint if UNTAINT;
if (not $o->{INLINE}{object_ready}) {
$o->check_config_file; # Final DIRECTORY set here.
push @config, $o->with_configs;
my $language = $o->{API}{language};
croak M04_error_nocode($language_id) unless $o->{API}{code};
$o->check_module;
}
$o->env_untaint if UNTAINT;
$o->obj_untaint if UNTAINT;
print_version() if $version_requested;
$o->reportbug() if $o->{CONFIG}{REPORTBUG};
if (not $o->{INLINE}{object_ready}
or $o->{CONFIG}{PRINT_INFO}
) {
eval "require $o->{INLINE}{ILSM_module}";
croak M05_error_eval('glue', $@) if $@;
$o->push_overrides;
bless $o, $o->{INLINE}{ILSM_module};
$o->validate(@config);
}
else {
$o->{CONFIG} = {(%{$o->{CONFIG}}, @config)};
}
$o->print_info if $o->{CONFIG}{PRINT_INFO};
unless ($o->{INLINE}{object_ready} or
not length $o->{INLINE}{ILSM_suffix}) {
$o->build();
$o->write_inl_file() unless $o->{CONFIG}{_INSTALL_};
}
if ($o->{INLINE}{ILSM_suffix} ne 'so' and
$o->{INLINE}{ILSM_suffix} ne 'dll' and
$o->{INLINE}{ILSM_suffix} ne 'bundle' and
$o->{INLINE}{ILSM_suffix} ne 'sl' and
ref($o) eq 'Inline'
) {
eval "require $o->{INLINE}{ILSM_module}";
croak M05_error_eval('glue', $@) if $@;
$o->push_overrides;
bless $o, $o->{INLINE}{ILSM_module};
$o->validate(@config);
}
$o->load;
$o->pop_overrides;
}
#==============================================================================
# Set up the USING overrides
inc/Inline.pm view on Meta::CPAN
$o->{INLINE}{object_ready} = 0;
unless ($o->{API}{code} =~ /^[A-Fa-f0-9]{32}$/) {
require Digest::MD5;
$o->{INLINE}{md5} = Digest::MD5::md5_hex($o->{API}{code});
}
else {
$o->{INLINE}{md5} = $o->{API}{code};
}
return if $o->{CONFIG}{_INSTALL_};
return unless $o->{CONFIG}{VERSION};
croak M26_error_version_without_name()
unless $o->{CONFIG}{NAME};
my @pkgparts = split(/::/, $o->{API}{pkg});
my $realname = File::Spec->catfile(@pkgparts) . '.pm';
my $realname_unix = File::Spec::Unix->catfile(@pkgparts) . '.pm';
my $realpath = $INC{$realname_unix}
or croak M27_module_not_indexed($realname_unix);
my ($volume,$dir,$file) = File::Spec->splitpath($realpath);
my @dirparts = File::Spec->splitdir($dir);
pop @dirparts unless $dirparts[-1];
push @dirparts, $file;
my @endparts = splice(@dirparts, 0 - @pkgparts);
$dirparts[-1] = 'arch'
if $dirparts[-2] eq 'blib' && $dirparts[-1] eq 'lib';
File::Spec->catfile(@endparts) eq $realname
or croak M28_error_grokking_path($realpath);
$realpath =
File::Spec->catpath($volume,File::Spec->catdir(@dirparts),"");
$o->{API}{version} = $o->{CONFIG}{VERSION};
$o->{API}{module} = $o->{CONFIG}{NAME};
my @modparts = split(/::/,$o->{API}{module});
$o->{API}{modfname} = $modparts[-1];
$o->{API}{modpname} = File::Spec->catdir(@modparts);
my $suffix = $Config{dlext};
my $obj = File::Spec->catfile($realpath,'auto',$o->{API}{modpname},
"$o->{API}{modfname}.$suffix");
croak M30_error_no_obj($o->{CONFIG}{NAME}, $o->{API}{pkg},
$realpath) unless -f $obj;
@{$o->{CONFIG}}{qw( PRINT_INFO
REPORTBUG
FORCE_BUILD
_INSTALL_
)} = (0, 0, 0, 0);
$o->{install_lib} = $realpath;
$o->{INLINE}{ILSM_type} = 'compiled';
inc/Inline.pm view on Meta::CPAN
package $pkg;
push \@$ {pkg}::ISA, qw($module)
unless \$module eq "$pkg";
local \$$ {module}::VERSION = '$version';
package $module;
push \@$ {module}::ISA, qw(Exporter DynaLoader);
sub dl_load_flags { $global }
${module}::->bootstrap;
END
croak M43_error_bootstrap($module, $@) if $@;
}
#==============================================================================
# Create file that satisfies the Makefile dependency for this object
#==============================================================================
sub satisfy_makefile_dep {
my $o = shift;
my $inline = $o->{API}{modinlname};
inc/Inline.pm view on Meta::CPAN
if(!$unlink) {warn "Failed to remove config file"}
else {warn "config file removed\n" if $o->{CONFIG}{_TESTING}}
$load_cfg->() ;
}
$Inline::languages = $config{languages};
{
no warnings ('numeric'); # These warnings were a pain with devel releases.
# If there's a problem with the version number, the
# error message will output $config{version} anyway.
croak M18_error_old_version($config{version}, $DIRECTORY)
unless (defined $config{version} and
$config{version} =~ /TRIAL/ or
$config{version} >= 0.40);
} # numeric warnings re-enabled.
croak M19_usage_language($o->{API}{language_id}, $DIRECTORY)
unless defined $config{languages}->{$o->{API}{language_id}};
$o->{API}{language} = $config{languages}->{$o->{API}{language_id}};
if ($o->{API}{language} ne $o->{API}{language_id}) {
if (defined $o->{$o->{API}{language_id}}) {
inc/Inline.pm view on Meta::CPAN
$usage .= <<END if defined $Inline::languages;
Supported languages:
${\ join(', ', sort keys %$Inline::languages)}
END
return $usage;
}
sub M04_error_nocode {
my ($language) = @_;
return <<END;
No $language source code found for Inline.
END
}
sub M05_error_eval {
my ($subroutine, $msg) = @_;
return <<END;
An eval() failed in Inline::$subroutine:
$msg
END
}
sub M06_code_file_failed_open {
my ($file) = @_;
inc/Inline.pm view on Meta::CPAN
sub M17_config_open_failed {
my ($dir) = @_;
my $file = File::Spec->catfile(${dir}, $configuration_file);
return <<END;
Can't open ${file} for input.
END
#'
}
sub M18_error_old_version {
my ($old_version, $directory) = @_;
$old_version ||= '???';
return <<END;
You are using Inline version $Inline::VERSION with a directory that was
configured by Inline version $old_version. This version is no longer supported.
Please delete the following directory and try again:
$directory
END
inc/Inline.pm view on Meta::CPAN
sub M21_opendir_failed {
my ($dir) = @_;
return <<END;
Can't open directory '$dir'.
END
#'
}
sub M22_usage_register {
my ($language, $error) = @_;
return <<END;
The module Inline::$language does not support the Inline API, because it does
properly support the register() method. This module will not work with Inline
and should be uninstalled from your system. Please advise your sysadmin.
The following error was generating from this module:
$error
END
}
sub M23_usage_alias_used {
my ($new_mod, $alias, $old_mod) = @_;
return <<END;
The module Inline::$new_mod is attempting to define $alias as an alias.
But $alias is also an alias for Inline::$old_mod.
inc/Inline.pm view on Meta::CPAN
my ($mod, $err) = @_;
return <<END;
You have requested "use Inline with => '$mod'"
but '$mod' does not work with Inline.
$err
END
}
sub M26_error_version_without_name {
return <<END;
Specifying VERSION option without NAME option is not permitted.
END
}
sub M27_module_not_indexed {
my ($mod) = @_;
return <<END;
You are attempting to load an extension for '$mod',
but there is no entry for that module in %INC.
END
}
sub M28_error_grokking_path {
my ($path) = @_;
return <<END;
Can't calculate a path from '$path' in %INC
END
}
sub M29_error_relative_path {
my ($name, $path) = @_;
return <<END;
Can't load installed extension '$name'
from relative path '$path'.
END
#'
}
sub M30_error_no_obj {
my ($name, $pkg, $path) = @_;
<<END;
The extension '$name' is not properly installed in path:
'$path'
If this is a CPAN/distributed module, you may need to reinstall it on your
system.
To allow Inline to compile the module in a temporary cache, simply remove the
Inline config option 'VERSION=' from the $pkg module.
inc/Inline.pm view on Meta::CPAN
Can't open Inline validate file:
$file
$!
END
#'
}
sub M32_error_md5_validation {
my ($md5, $inl) = @_;
return <<END;
The source code fingerprint:
$md5
does not match the one in:
$inl
This module needs to be reinstalled.
END
}
sub M33_error_old_inline_version {
my ($inl) = @_;
return <<END;
The following extension is not compatible with this version of Inline.pm.
$inl
You need to reinstall this extension.
END
}
sub M34_error_incorrect_version {
my ($inl) = @_;
return <<END;
The version of your extension does not match the one indicated by your
Inline source code, according to:
$inl
This module should be reinstalled.
END
}
sub M35_error_no_object_file {
my ($obj, $inl) = @_;
return <<END;
There is no object file:
$obj
For Inline validation file:
$inl
This module should be reinstalled.
inc/Inline.pm view on Meta::CPAN
END
}
sub M42_usage_loader {
return <<END;
ERROR. The loader that was invoked is for compiled languages only.
END
}
sub M43_error_bootstrap {
my ($mod, $err) = @_;
return <<END;
Had problems bootstrapping Inline module '$mod'
$err
END
}
sub M45_usage_with {
return <<END;
Syntax error detected using 'use Inline with ...'.
Should be specified as:
use Inline with => 'module1', 'module2', ..., 'moduleN';
END
}
sub M46_usage_with_bad {
my $mod = shift;
return <<END;
Syntax error detected using 'use Inline with => "$mod";'.
'$mod' could not be found.
END
}
sub M47_invalid_config_option {
my ($option) = @_;
return <<END;
Invalid Config option '$option'
inc/Inline/C.pm view on Meta::CPAN
my $build_noisy = defined $ENV{PERL_INLINE_BUILD_NOISY}
? $ENV{PERL_INLINE_BUILD_NOISY}
: $o->{CONFIG}{BUILD_NOISY};
# test this functionality with:
#perl -MInline=C,Config,BUILD_NOISY,1,FORCE_BUILD,1 -e "use Inline C => q[void inline_warner() { int *x = 2; }]"
if (not $build_noisy) {
$cmd = "$cmd > $output_file 2>&1";
}
($cmd) = $cmd =~ /(.*)/ if $o->UNTAINT;
system($cmd) == 0
or croak($o->build_error_message($cmd, $output_file, $build_noisy));
}
sub build_error_message {
my ($o, $cmd, $output_file, $build_noisy) = @_;
my $build_dir = $o->{API}{build_dir};
my $output = '';
if (not $build_noisy and
open(OUTPUT, $output_file)
) {
local $/;
$output = <OUTPUT>;
close OUTPUT;
}
my $errcode = $? >> 8;
$output .= <<END;
A problem was encountered while attempting to compile and install your Inline
$o->{API}{language} code. The command that failed was:
\"$cmd\" with error code $errcode
The build directory was:
$build_dir
To debug the problem, cd to the build directory, and inspect the output files.
END
if ($cmd =~ /^make >/) {
for (sort keys %ENV) {
$output .= "Environment $_ = '$ENV{$_}'\n" if /^(?:MAKE|PATH)/;
inc/Inline/Module.pm view on Meta::CPAN
warn <<"...";
It seems that '$stub_module' is out of date.
It is using Inline::Module API version '$api_version'.
You have Inline::Module API version '$API_VERSION' installed.
Make sure you have the latest version of Inline::Module installed, then run:
perl -MInline::Module=makestub,$stub_module
...
# XXX 'exit' is used to get a cleaner error msg.
# Try to redo this without 'exit'.
exit 1;
}
}
sub check_inc_inc {
my ($class, $program) = @_;
my $first = $INC[0] or die;
if ($first !~ /^(\.[\/\\])?inc[\/\\]?$/) {
die <<"...";
inc/Inline/denter.pm view on Meta::CPAN
my $stream = $symbol;
$stream .= $2 if defined $2;
$o->{xref}{$3}++;
croak "Inline::denter does not handle duplicate references"
if $o->{xref}{$3} > 1;
$stream .= "\n";
$stream .= $o->{key}, $o->{key} = '' if $o->{key};
return $stream;
}
# Undent error messages
sub M01_invalid_indent_width {
my $o = shift;
"Invalid indent width detected at line $o->{line}\n";
}
sub M02_no_key_end_marker {
my ($marker, $line) = @_;
"No terminating marker '$marker' found for key at line $line\n";
}