summaryrefslogtreecommitdiff
path: root/dev-perl/Bio-DB-HTS/files/2.11-build_env_ldflags.patch
blob: eef0779141830662dc5c96073ca35ff2e9c05f55 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- a/Build.PL
+++ b/Build.PL
@@ -107,11 +107,17 @@
     my $hts_include = $self->config_data('hts_include');
     my $hts_lib     = $self->config_data('hts_lib');
     my $static      = $self->args('static');
+
+    my @env_linker_flags;
+    if ( defined $ENV{LDFLAGS} ) {
+        @env_linker_flags = split qr{\s+}, $ENV{LDFLAGS};
+    }
+
     $self->include_dirs([$hts_include]);
     if($static){
-      $self->extra_linker_flags("-L$hts_lib", '-lhts', '-lpthread', '-lz');
+      $self->extra_linker_flags(@env_linker_flags, "-L$hts_lib", '-lhts', '-lpthread', '-lz');
     }else{
-      $self->extra_linker_flags("-L$hts_lib", "-Wl,-rpath,$hts_lib", '-lhts', '-lpthread', '-lz');
+      $self->extra_linker_flags(@env_linker_flags, "-L$hts_lib", "-Wl,-rpath,$hts_lib", '-lhts', '-lpthread', '-lz');
     }
 }