Permalink
Browse files

Use static libraries instead of shared libraries

  • Loading branch information...
1 parent cca8300 commit cb7db6c8ebdb477551d48b888cf614bd866d4811 @jtpalmer committed Apr 22, 2012
Showing with 10 additions and 9 deletions.
  1. +10 −9 lib/Alien/Base/ModuleBuild.pm
@@ -449,7 +449,7 @@ sub alien_generate_manual_pkgconfig {
#if no provides_libs then generate -l list from found files
unless ($provides_libs) {
- my @files = map { "-l$_" } @{$paths->{so_files}};
+ my @files = map { "-l$_" } @{$paths->{a_files}};
$provides_libs = join( ' ', @files );
}
@@ -487,31 +487,32 @@ sub alien_find_lib_paths {
@libs = map { /-l(.*)/ ? $1 : () } split /\s+/, $libs if $libs;
$libs[0] = '' unless @libs; #find all so files if no provides_libs;
- my $ext = $self->config('so'); #platform specific .so extension
+ my $ext = $self->config('lib_ext'); #platform specific .a extension
+ $ext =~ s/^\.//;
- my @so_files = sort #easier testing
+ my @a_files = sort #easier testing
map { File::Spec->abs2rel( $_, $dir ) } # make relative to $dir
- map { @{ $self->rscan_dir($dir, qr/$_\.$ext$/) } } #find all .so
+ map { @{ $self->rscan_dir($dir, qr/$_\.$ext$/) } } #find all .a
@libs;
my @lib_paths = uniq
map { File::Spec->catdir($_) } # remove trailing /
map { ( File::Spec->splitpath($_) )[1] } # get only directory
- @so_files;
+ @a_files;
- @so_files =
+ @a_files =
map { my $file = $_; $file =~ s/^(?:lib)?(.*?)\.$ext$/$1/; $file }
map { ( File::Spec->splitpath($_) )[2] }
- @so_files;
+ @a_files;
my @inc_paths = uniq
map { File::Spec->catdir($_) } # remove trailing /
map { ( File::Spec->splitpath($_) )[1] } # get only directory
map { File::Spec->abs2rel( $_, $dir ) } # make relative to $dir
- map { @{ $self->rscan_dir($dir, qr/$_\.h$/) } } #find all .so
+ map { @{ $self->rscan_dir($dir, qr/$_\.h$/) } } #find all .a
@libs;
- return { lib => \@lib_paths, inc => \@inc_paths, so_files => \@so_files };
+ return { lib => \@lib_paths, inc => \@inc_paths, a_files => \@a_files };
}
1;

0 comments on commit cb7db6c

Please sign in to comment.