Permalink
Browse files

use Devel::CheckLib

  • Loading branch information...
1 parent e5ee651 commit 6a0d7e55f75c8bb4e701bb50392ad6ddfc956e4e @gray committed Sep 2, 2009
Showing with 399 additions and 14 deletions.
  1. +22 −14 Makefile.PL
  2. +377 −0 inc/Devel/CheckLib.pm
View
@@ -1,29 +1,37 @@
use strict;
use warnings;
+use Config;
use ExtUtils::MakeMaker;
-# Eventually use Devel::CheckLib
-exit if $ENV{AUTOMATED_TESTING};
+use lib qw(inc);
+use Devel::CheckLib;
-my $libs = join ' ', grep { defined } @ENV{qw(LDFLAGS LD_LIBRARY_PATH)};
-my $inc = join ' ', grep { defined } @ENV{qw(CFLAGS CXXFLAGS CPPFLAGS)};
+check_lib_or_exit(
+ lib => [qw( stree )],
+ libpath => [ split ' ', $Config{loclibpth} ],
+ header => 'libstree.h',
+ incpath => [ split ' ', $Config{locincpth} ],
+);
-WriteMakefile(
+my %conf = (
NAME => 'Tree::Suffix',
AUTHOR => 'gray <gray@cpan.org>',
LICENSE => 'perl',
VERSION_FROM => 'lib/Tree/Suffix.pm',
ABSTRACT_FROM => 'lib/Tree/Suffix.pm',
PREREQ_PM => { 'Test::More' => 0 },
- LIBS => [ "$libs -lstree" ],
- INC => $inc,
- (eval { ExtUtils::MakeMaker->VERSION(6.46) } ? (
- META_MERGE => {
- resources => {
- repository => 'http://github.com/gray/tree-suffix',
- }
- }
- ) : () ),
+ LIBS => [ "-lstree" ],
+ META_MERGE => {
+ resources => {
+ repository => 'http://github.com/gray/tree-suffix',
+ },
+ },
dist => { COMPRESS => 'gzip -9f', SUFFIX => '.gz', },
clean => { FILES => 'Tree-Suffix-*' },
);
+
+unless (eval { ExtUtils::MakeMaker->VERSION(6.46) }) {
+ delete $conf{META_MERGE};
+}
+
+WriteMakefile(%conf);
Oops, something went wrong.

0 comments on commit 6a0d7e5

Please sign in to comment.