make the bindings work on os x
[rrdtool.git] / bindings / perl-shared / Makefile.PL
1 use ExtUtils::MakeMaker;
2 use Config;
3 # See lib/ExtUtils/MakeMaker.pm for details of how to influence
4 # the contents of the Makefile that is written.
5
6 # Specify the location of the archive containing PIC compiled object files.
7 my $R = "";
8
9
10 for ($^O){
11         /linux/   && do{ $R = "-Wl,--rpath -Wl,\$(RPATH)"};
12         /hpux/    && do{ $R = "+b\$(RPATH)"};
13         /solaris/ && do{ $R = "-R\$(RPATH)"};
14 }
15
16 # darwin works without this because librrd contains its
17 # install_name which will includes the final location of the
18 # library after it is installed. This install_name gets transfered
19 # to the perl shared object.
20
21 my $librrd = "-L../../src/.libs/ $R -lrrd";
22
23 WriteMakefile(
24     'NAME'         => 'RRDs',
25     'VERSION_FROM' => 'RRDs.pm', # finds $VERSION
26     'DEFINE'       => "-DPERLPATCHLEVEL=$Config{PATCHLEVEL}",
27     'INC'          => '-I../../src',
28     # Perl will figure out which one is valid
29     'dynamic_lib'  => {'OTHERLDFLAGS' => "$librrd -lm"},
30     'realclean'    => {FILES => 't/demo?.rrd t/demo?.png' }
31 );