summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3929b04)
raw | patch | inline | side by side (parent: 3929b04)
author | Florian Forster <octo@verplant.org> | |
Sat, 26 Jan 2008 17:50:40 +0000 (18:50 +0100) | ||
committer | Florian Forster <octo@verplant.org> | |
Sat, 26 Jan 2008 17:50:40 +0000 (18:50 +0100) |
bindings/perl/Changes | patch | blob | history | |
bindings/perl/Makefile.PL | patch | blob | history |
diff --git a/bindings/perl/Changes b/bindings/perl/Changes
index 974a18937b35f71721fd04194d2d3b969b4f41e9..ea4a6122211d1582de6c9ca193b765fc87944650 100644 (file)
--- a/bindings/perl/Changes
+++ b/bindings/perl/Changes
Revision history for Perl extension Net::Oping.
+1.01 ...
+ - Have `Makefile.PL' exit if the header file <oping.h> cannot be found
+ _before_ a Makefile is generated. This is done because
+ `ExtUtils::MakeMaker' doesn't check whether libraries exist and this
+ seems to be the standard way of dealing with this. A (hopefully)
+ informative message is written to STDERR in this case.
+
1.00 Sat Jan 26 13:52:11 2008
- The module has been renamed from `Oping' to `Net::Oping'.
- - The XS code has been simplyfied and a high-level interface has been
+ - The XS code has been simplified and a high-level interface has been
created in Perl.
0.01 Wed Oct 24 01:32:19 2007
index 4e375a5941ecb688e146a2bf336651dc652c7605..f2ddf0ace2e6c1adf4d9dafbacb4c854760e69f1 100644 (file)
use 5.008007;
use ExtUtils::MakeMaker;
+my @OPING_PREFIX = (qw(/opt/oping /usr /usr/local));
+my $OPING_PREFIX;
+
+for (my $i = 0; $i < @ARGV; $i++)
+{
+ if ($ARGV[$i] =~ m#^OPING_PREFIX=(.*[^/])#)
+ {
+ unshift (@OPING_PREFIX, $1);
+ splice (@ARGV, $i, 1);
+ $i--;
+ }
+}
+
+for (my $i = 0; $i < @OPING_PREFIX; $i++)
+{
+ if (!-e $OPING_PREFIX[$i] . '/include/oping.h')
+ {
+ next;
+ }
+
+ $OPING_PREFIX = $OPING_PREFIX[$i];
+ print "Found <oping.h> in $OPING_PREFIX/include\n";
+ last;
+}
+
+if (!$OPING_PREFIX)
+{
+ my $search_path = join (', ', @OPING_PREFIX);
+ print STDERR <<EOF;
+******************************************************************************
+* ERROR: COULD NOT FIND THE NEEDED HEADER FILE <oping.h>! *
+******************************************************************************
+The <oping.h> header file could not be found in the usual places. The prefix
+paths searched right now are:
+ $search_path
+
+Please rerun Makefile.PL giving the prefix to the oping library using the
+`OPING_PREFIX' argument. If you, for example, had installed the oping library
+to /tmp/oping, the header file would be at /tmp/oping/include/oping.h; you'd
+then need to run the Makefile.PL as follows:
+ perl Makefile.PL OPING_PREFIX=/tmp/oping
+
+As you can see, the argument passed via `OPING_PREFIX' must be the same
+directory you passed to the liboping configure script using the `--prefix'
+argument.
+
+No Makefile has been created.
+EOF
+ exit (0);
+}
+
WriteMakefile(
NAME => 'Net::Oping',
VERSION_FROM => 'lib/Net/Oping.pm',
? (ABSTRACT_FROM => 'lib/Net/Oping.pm',
AUTHOR => 'Florian Forster <octo@verplant.org>')
: ()),
- LIBS => ['-loping', '-L/opt/oping/lib/ -loping'],
+ LIBS => ["-L$OPING_PREFIX/lib -loping"],
DEFINE => '',
- INC => '-I/opt/oping/include/'
+ INC => "-I$OPING_PREFIX/include"
);