Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Put Inline::CPP::Config replacement in share.
- Loading branch information
1 parent
03c3d3d
commit c02d961
Showing
3 changed files
with
102 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ author: | |
|
||
requires: | ||
perl: 5.8.1 | ||
File::Share: 0 | ||
Inline: 0 | ||
Inline::C: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# This module comes from Inline::Module share file: 'CPPConfig.pm' | ||
|
||
use strict; use warnings; | ||
package Inline::CPP::Config; | ||
|
||
use Config; | ||
# use ExtUtils::CppGuess; | ||
|
||
our ($compiler, $libs, $iostream_fn, $cpp_flavor_defs) = cpp_guess(); | ||
|
||
my $cpp_info; | ||
BEGIN { | ||
my $default_headers = <<'.'; | ||
#define __INLINE_CPP_STANDARD_HEADERS 1 | ||
#define __INLINE_CPP_NAMESPACE_STD 1 | ||
. | ||
my @default_info = ( | ||
'g++ -xc++', | ||
'-lstdc++', | ||
'iostream', | ||
$default_headers, | ||
); | ||
$cpp_info = { | ||
'cygwin' => [ @default_info ], | ||
'darwin' => [ @default_info ], | ||
'linux' => [ @default_info ], | ||
'MSWin32' => [ @default_info ], | ||
}; | ||
} | ||
|
||
sub throw; | ||
sub cpp_guess { | ||
my $key = $Config::Config{osname}; | ||
if (my $config = $cpp_info->{$key}) { | ||
$config->[0] .= ' -D_FILE_OFFSET_BITS=64', | ||
if $Config::Config{ccflags} =~ /-D_FILE_OFFSET_BITS=64/; | ||
return @$config; | ||
} | ||
|
||
throw "Unsupported OS/Compiler for Inline::Module+Inline::CPP '$key'"; | ||
} | ||
|
||
sub throw { | ||
die "@_" unless | ||
$ENV{PERL5_MINISMOKEBOX} || | ||
$ENV{PERL_CR_SMOKER_CURRENT}; | ||
eval 'use lib "inc"; use Inline::Module; 1' or die $@; | ||
Inline::Module->smoke_system_info_dump(); | ||
} | ||
|
||
1; |