Skip to content
Browse files

Setting LD_LIBRARY_PATH to Alien::SDL's libdir for OpenBSD

  • Loading branch information...
1 parent 24042ef commit 0dbab303b8e5d32c27c52da3220292b0445a1621 Tobias Leich committed Dec 13, 2010
Showing with 11 additions and 0 deletions.
  1. +2 −0 CHANGELOG
  2. +9 −0 lib/SDL/Internal/Loader.pm
View
2 CHANGELOG
@@ -6,6 +6,8 @@ Revision history for Perl extension SDL_perl.
- AudioSpec callbacks are using *_TLS_CONTEXT macros [FROGGS]
- SDL::Timer is using *_TLS_CONTEXT macros [FROGGS]
- Fixed typo in MANIFEST.SKIP file, scripts-folder is now in dist [FROGGS]
+ - Setting LD_LIBRARY_PATH to Alien::SDL's libdir for OpenBSD [FROGGS]
+ - Using UV instead of IV for SDL::Event attributes [kthakore]
* 2.524
- Fix for t/mixer_channels.t.bak
View
9 lib/SDL/Internal/Loader.pm
@@ -9,6 +9,15 @@ our @LIBREFS = ();
use SDL::ConfigData;
use Alien::SDL;
+if($^O eq 'openbsd') {
+ my $alien_libdir = Alien::SDL->config('prefix') . '/lib';
+ if($alien_libdir && (!defined $ENV{LD_LIBRARY_PATH} || $ENV{LD_LIBRARY_PATH} !~ /$alien_libdir/)) {
+ $ENV{LD_LIBRARY_PATH} = $ENV{LD_LIBRARY_PATH}
+ ? "$alien_libdir:$ENV{LD_LIBRARY_PATH}"
+ : $alien_libdir;
+ }
+}
+
# SDL::Internal::Loader is a king of "Dynaloader kung-fu" that is
# necessary in situations when you install Allien::SDL from sources
# or from prebuilt binaries as in these scenarios the SDL stuff is

0 comments on commit 0dbab30

Please sign in to comment.
Something went wrong with that request. Please try again.