| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Alien::DBD::SQLite::BundledExtensions; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 530 | use Config; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 50 |  | 
| 4 | 1 |  |  | 1 |  | 607 | use File::ShareDir 'dist_dir'; | 
|  | 1 |  |  |  |  | 27709 |  | 
|  | 1 |  |  |  |  | 381 |  | 
| 5 |  |  |  |  |  |  |  | 
| 6 |  |  |  |  |  |  | our $VERSION=0.002; | 
| 7 |  |  |  |  |  |  | our @extensions = qw/spellfix csv ieee754 nextchar percentile series totype wholenumber eval/; | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | my $dbd_dist = dist_dir('DBD-SQLite'); | 
| 10 |  |  |  |  |  |  | my $cc = $Config{cc}; | 
| 11 |  |  |  |  |  |  |  | 
| 12 |  |  |  |  |  |  | # TODO this probably doesn't work on windows anyway.  Need to look into how to make that work correctly anyway. | 
| 13 |  |  |  |  |  |  | my $lib_ext = $^O =~ /mswin/ ? 'dll' : | 
| 14 |  |  |  |  |  |  | $^O =~ /darwin/ ? 'dylib' : 'so'; | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | # TODO this needs to support mswin32 | 
| 17 |  |  |  |  |  |  |  | 
| 18 |  |  |  |  |  |  |  | 
| 19 |  |  |  |  |  |  |  | 
| 20 |  |  |  |  |  |  | sub get_build_commands { | 
| 21 | 0 | 0 |  | 0 | 0 |  | my $shared = $^O =~ /darwin/ ? '-dynamiclib' : '-shared'; | 
| 22 | 0 |  |  |  |  |  | my @build_commands = map {"$cc $shared -I$dbd_dist -O2 -fPIC -o $_.$lib_ext ext/misc/$_.c"} @extensions; | 
|  | 0 |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  |  | 
| 24 | 0 |  |  |  |  |  | return \@build_commands; | 
| 25 |  |  |  |  |  |  | } | 
| 26 |  |  |  |  |  |  |  | 
| 27 |  |  |  |  |  |  | sub get_install_commands { | 
| 28 | 0 | 0 |  | 0 | 0 |  | my $copy_cmd = $^O =~ /mswin/ ? 'copy' : 'cp'; | 
| 29 | 0 |  |  |  |  |  | my @install_commands = map {"$copy_cmd $_.$lib_ext %s"} @extensions; | 
|  | 0 |  |  |  |  |  |  | 
| 30 |  |  |  |  |  |  |  | 
| 31 | 0 |  |  |  |  |  | return \@install_commands; | 
| 32 |  |  |  |  |  |  | } | 
| 33 |  |  |  |  |  |  |  | 
| 34 |  |  |  |  |  |  | 1; | 
| 35 |  |  |  |  |  |  | __END__ |