summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordaniel <danieruru@gmail.com>2013-01-09 20:48:44 +0900
committerdaniel <danieruru@gmail.com>2013-01-09 20:48:44 +0900
commita150256d6423ab2131a529afd58b496e26b4c716 (patch)
treebab5d37ea16d4e6331071648eb976ec03fbd9ff2
parent57bec4c29edc96491328c8f60fe76055ab2f4008 (diff)
The perl module sort of works now. Need to fill in all of the meta data, add proper tests etc.
-rw-r--r--libvxi11client/Makefile9
-rw-r--r--libvxi11client/libvxi11client.h1
-rw-r--r--libvxi11client/perlbits/Makefile.PL39
-rw-r--r--libvxi11client/perlbits/VXI11-Client.t21
4 files changed, 68 insertions, 2 deletions
diff --git a/libvxi11client/Makefile b/libvxi11client/Makefile
index 3b6348a..2901032 100644
--- a/libvxi11client/Makefile
+++ b/libvxi11client/Makefile
@@ -25,4 +25,11 @@ clean:
perl:
-rm -rf VXI11-Client
- h2xs -M vxi11 -x -n VXI11::Client libvxi11client.h
+ h2xs -A -M vxi11 -x -n VXI11::Client libvxi11client.h
+ cp vxi11.h libvxi11client.c libvxi11client.h vxi11_clnt.c vxi11_xdr.c VXI11-Client/
+ cp perlbits/Makefile.PL VXI11-Client/
+ cp perlbits/VXI11-Client.t VXI11-Client/t/
+ cd VXI11-Client/ && perl Makefile.PL
+ cd VXI11-Client/ && make
+ cd VXI11-Client/ && make test
+
diff --git a/libvxi11client/libvxi11client.h b/libvxi11client/libvxi11client.h
index b76fe55..c9779e4 100644
--- a/libvxi11client/libvxi11client.h
+++ b/libvxi11client/libvxi11client.h
@@ -1,5 +1,4 @@
#include <stdbool.h>
-#include "vxi11.h"
#define ERR_SYNTAXERROR -1
#define ERR_DEVICENOTACCESSIBLE -3
diff --git a/libvxi11client/perlbits/Makefile.PL b/libvxi11client/perlbits/Makefile.PL
new file mode 100644
index 0000000..801c91f
--- /dev/null
+++ b/libvxi11client/perlbits/Makefile.PL
@@ -0,0 +1,39 @@
+use 5.014002;
+use ExtUtils::MakeMaker;
+# See lib/ExtUtils/MakeMaker.pm for details of how to influence
+# the contents of the Makefile that is written.
+WriteMakefile(
+ NAME => 'VXI11::Client',
+ VERSION_FROM => 'lib/VXI11/Client.pm', # finds $VERSION
+ PREREQ_PM => {}, # e.g., Module::Name => 1.1
+ ($] >= 5.005 ? ## Add these new keywords supported since 5.005
+ (ABSTRACT_FROM => 'lib/VXI11/Client.pm', # retrieve abstract from module
+ AUTHOR => 'daniel <daniel@>') : ()),
+ LIBS => [''], # e.g., '-lm'
+ DEFINE => '', # e.g., '-DHAVE_SOMETHING'
+ INC => '-I.', # e.g., '-I. -I/usr/include/other'
+ OBJECT => '$(O_FILES)', # link all the C files too
+);
+if (eval {require ExtUtils::Constant; 1}) {
+ # If you edit these definitions to change the constants used by this module,
+ # you will need to use the generated const-c.inc and const-xs.inc
+ # files to replace their "fallback" counterparts before distributing your
+ # changes.
+ my @names = (qw());
+ ExtUtils::Constant::WriteConstants(
+ NAME => 'VXI11::Client',
+ NAMES => \@names,
+ DEFAULT_TYPE => 'IV',
+ C_FILE => 'const-c.inc',
+ XS_FILE => 'const-xs.inc',
+ );
+
+}
+else {
+ use File::Copy;
+ use File::Spec;
+ foreach my $file ('const-c.inc', 'const-xs.inc') {
+ my $fallback = File::Spec->catfile('fallback', $file);
+ copy ($fallback, $file) or die "Can't copy $fallback to $file: $!";
+ }
+}
diff --git a/libvxi11client/perlbits/VXI11-Client.t b/libvxi11client/perlbits/VXI11-Client.t
new file mode 100644
index 0000000..d156ffb
--- /dev/null
+++ b/libvxi11client/perlbits/VXI11-Client.t
@@ -0,0 +1,21 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl VXI11-Client.t'
+
+#########################
+
+# change 'tests => 1' to 'tests => last_test_to_print';
+
+use strict;
+use warnings;
+
+use Test::More tests => 3;
+BEGIN { use_ok('VXI11::Client') };
+
+#########################
+
+# Insert your test code below, the Test::More module is use()ed here so read
+# its man page ( perldoc Test::More ) for help writing this test script.
+
+is(&VXI11::Client::vxi11_open("roi", 0), 1);
+is(&VXI11::Client::vxi11_unlock(), 1);
+is(&VXI11::Client::vxi11_close(), 1);