diff options
author | Oliver Tappe | 2008-10-08 23:38:01 +0200 |
---|---|---|
committer | Oliver Tappe | 2008-10-08 23:38:01 +0200 |
commit | 51b57cec06af74748f38ebcdc786a024c5066a1f (patch) | |
tree | 1903943ab2382799a125d050fe181f0e9fda76ec /lib/OpenSLX/Syscall.pm | |
parent | vmchooser: * wrong fix checked in accidentally (diff) | |
download | core-51b57cec06af74748f38ebcdc786a024c5066a1f.tar.gz core-51b57cec06af74748f38ebcdc786a024c5066a1f.tar.xz core-51b57cec06af74748f38ebcdc786a024c5066a1f.zip |
* first try at making sure that the required Perl-headers exist before we try
to use one of them
git-svn-id: http://svn.openslx.org/svn/openslx/openslx/trunk@2275 95ad53e4-c205-0410-b2fa-d234c58c8868
Diffstat (limited to 'lib/OpenSLX/Syscall.pm')
-rw-r--r-- | lib/OpenSLX/Syscall.pm | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/OpenSLX/Syscall.pm b/lib/OpenSLX/Syscall.pm index a46d9ac6..faf223f8 100644 --- a/lib/OpenSLX/Syscall.pm +++ b/lib/OpenSLX/Syscall.pm @@ -30,6 +30,8 @@ before trying to invoke the respective syscall. =cut +use File::Path; + use OpenSLX::Basics; =head1 PUBLIC FUNCTIONS @@ -58,14 +60,19 @@ sub _loadPerlHeader { my @phFiles = @_; + my $phLibDir = "$openslxConfig{'base-path'}/lib/ph"; + mkpath($phLibDir) unless -e $phLibDir; + + local @INC = @INC; + push @INC, $phLibDir; + for my $phFile (@phFiles) { if (!eval { require $phFile }) { # perl-header has not been provided by host-OS, so we create it # manually from C-header (via h2ph): (my $hFile = $phFile) =~ s{\.ph$}{.h}; if (-e "/usr/include/$hFile") { - my $libDir = "$openslxConfig{'base-path'}/lib"; - slxsystem("cd /usr/include && h2ph -d $libDir $hFile") == 0 + slxsystem("cd /usr/include && h2ph -d $phLibDir $hFile") == 0 or die _tr('unable to create %s! (%s)', $phFile, $!); } } |