Building for perl-5.8.1 with libSDL and some modules installed in
/opt/libSDL-1.2.7 I had a couple of problems:
1. because the library is installed to a nonstandard place, none of
the autodetect paths mentioned in SDL::Build::Linux->fetch_includes
matched, so $links->{$subsystem}{libs} was undefined for several
subsystems giving the previously reported problem "can't use undefined
value as an ARRAY reference" in SDL::Build->set_flags.
2. on my system, `sdl-config --cflags` returns two arguments:
-I/opt/libSDL-1.2.7/include/SDL -D_REENTRANT
Now, because the extra_compiler_flags are constructed as:
extra_compiler_flags =>
[
@{ $includes->{$subsystem} },
$sdl_compile,
@{ $defines->{$subsystem} },
( defined $Config{usethreads} ? ('-DUSE_THREADS', '-fPIC') : '-fPIC' ),
],
.. Module::Build sees a list, so doesn't split the individual arguments,
and eventually "-I/opt/libSDL-1.2.7/include/SDL -D_REENTRANT" gets passed
to gcc as a single argument, and the wrong things happen.
I worked around these two problems using the patch below, but the simplistic
split(' ', ...) may be insufficient if an include path itself can contain
whitespace: you'd need to check what sdl-config returns in such a case,
and cater for it.
That allowed me to complete the build, and testing then gave several failures;
in synopsis:
Failed Test Stat Wstat Total Fail Failed List of Failed
-------------------------------------------------------------------------------
t/mixerpm.t 127 32512 3 2 66.67% 3
t/toolfontpm.t 2 512 2 2 100.00% 1-2
t/ttfontpm.t 1 256 2 1 50.00% 1
Now I don't have SDL_ttf installed, since I wasn't able to find a tarball
for it: I guess that somewhere along the line the build process should be
spotting that the library isn't installed, and skipping these tests.
Since I don't have a sound driver installed I didn't particularly expect
success from the mixerpm tests, but the error messages suggest that the
problem may have occurred earlier:
t/mixerpm..........ok 2/3Use of inherited AUTOLOAD for non-method
SDL::MixOpenAudio() is deprecated at blib/lib/SDL/Mixer.pm line 28, <DATA> line 266.
Can't locate auto/SDL/MixOpenAudi.al in @INC (@INC contains: blib/lib blib/arch
/src/package/lang/perl/SDL_Perl-2.1.0/blib/lib
/src/package/lang/perl/SDL_Perl-2.1.0/blib/arch
/src/package/lang/perl/SDL_Perl-2.1.0/make/lib /opt/perl-5.8.1/lib/5.8.1/i686-linux
/opt/perl-5.8.1/lib/5.8.1/i686-linux /opt/perl-5.8.1/lib/5.8.1
/opt/perl-5.8.1/lib/site_perl/5.8.1/i686-linux
/opt/perl-5.8.1/lib/site_perl/5.8.1/i686-linux /opt/perl-5.8.1/lib/site_perl/5.8.1
/opt/perl-5.8.1/lib/site_perl/5.8.1/i686-linux /opt/perl-5.8.1/lib/site_perl/5.8.1
/opt/perl-5.8.1/lib/site_perl /src/package/lang/perl/SDL_Perl-2.1.0
/opt/perl-5.8.1/lib/5.8.1/i686-linux /opt/perl-5.8.1/lib/5.8.1
/opt/perl-5.8.1/lib/site_perl/5.8.1/i686-linux /opt/perl-5.8.1/lib/site_perl/5.8.1
/opt/perl-5.8.1/lib/site_perl .) at blib/lib/SDL/Mixer.pm line 28
# Looks like you planned 3 tests but only ran 2.
# Looks like your test died just after 2.
/opt/perl-5.8.1/bin/perl: relocation error: /usr/lib/libmcop.so.0: undefined symbol:
internalFreeAll__Q24Arts14StartupManager
t/mixerpm..........dubious
Test returned status 127 (wstat 32512, 0x7f00)
DIED. FAILED test 3
Failed 1/3 tests, 66.67% okay
Hope this helps,
Hugo
--- make/lib/SDL/Build.pm.old Thu Jul 15 17:02:25 2004
+++ make/lib/SDL/Build.pm Thu Jul 15 17:12:57 2004
@@ -142,16 +142,16 @@
{
extra_compiler_flags =>
[
- @{ $includes->{$subsystem} },
- $sdl_compile,
- @{ $defines->{$subsystem} },
+ @{ $includes->{$subsystem} || [] },
+ split(' ', $sdl_compile),
+ @{ $defines->{$subsystem} || [] },
( defined $Config{usethreads} ? ('-DUSE_THREADS',
'-fPIC') : '-fPIC' ),
],
extra_linker_flags =>
[
- @{ $links->{$subsystem}{paths} },
- $sdl_link,
- @{ $links->{$subsystem}{libs} },
+ @{ $links->{$subsystem}{paths} || [] },
+ split(' ', $sdl_link),
+ @{ $links->{$subsystem}{libs} || [] },
],
},
}