Skip to contentSkip to conversation

bindings/perl configure

Cluster-devel Fabio M. Di Nitto 1 participant 1 message Jul 29, 2008

lore
Share & tools
lore
#0 lore raw
 bindings/perl/Makefile        |   15 +++-
 bindings/perl/ccs/CCS.pm      |  145 ++++++++++++++++++++++++++++++++++++++++++
 bindings/perl/ccs/CCS.xs      |   82 +++++++++++++++++++++++
 bindings/perl/ccs/MANIFEST    |    7 ++
 bindings/perl/ccs/META.yml    |   13 +++
 bindings/perl/ccs/Makefile.PL |   28 ++++++++
 bindings/perl/ccs/test.pl     |   20 +++++
 bindings/perl/ccs/typemap     |   14 ++++
 configure                     |    7 ++
 9 files changed, 329 insertions(+), 2 deletions(-)

New commits:
commit 3b97eed446aef7b19c0547dc3d31abe16990891e

Author: Fabio M. Di Nitto <[email protected]>
Date:   Tue Jul 29 21:03:16 2008 +0200

bindings: add first cut of perl Cluster:CCS

Add new perl binding for libccs.

This is a first version and while the code works fine, the build system and many other details are still not clean.

bindings/perl/Makefile +13 -2
index 810b2d4..91fefc4 100644
@@ -1,4 +1,15 @@
 include ../../make/defines.mk
-include $(OBJDIR)/make/passthrough.mk
 
-SUBDIRS=
+SUBDIRS=ccs
+
+all: ${SUBDIRS}
+
+%:
+	set -e && \
+	for i in ${SUBDIRS}; do \
+		cd $$i; \
+		perl Makefile.PL INC='-I${ccsincdir}' LIBS='-L${ccslibdir} -lccs' INSTALLDIRS=vendor; \
+		${MAKE} $@ LD_RUN_PATH=""; \
+		rm -f Makefile.old; \
+		cd ..; \
+	done
bindings/perl/ccs/CCS.pm new file +145 -0

145 lines not on this page · raw message

bindings/perl/ccs/CCS.xs new file +82 -0

82 lines not on this page · raw message

bindings/perl/ccs/MANIFEST new file +7 -0
new file mode 100644
index 0000000..c089dd7
@@ -0,0 +1,7 @@
+CCS.pm
+CCS.xs
+Makefile.PL
+MANIFEST
+test.pl
+typemap
+META.yml                                 Module meta-data (added by MakeMaker)
bindings/perl/ccs/META.yml new file +13 -0
new file mode 100644
index 0000000..eda2445
@@ -0,0 +1,13 @@
+--- #YAML:1.0
+name:                Cluster-CCS
+version:             0.01
+abstract:            ~
+license:             ~
+author:              
+    - Fabio M. Di Nitto <[email protected]>
+generated_by:        ExtUtils::MakeMaker version 6.42
+distribution_type:   module
+requires:     
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.3.html
+    version: 1.3
bindings/perl/ccs/Makefile.PL new file +28 -0
new file mode 100644
index 0000000..b5504ea
@@ -0,0 +1,28 @@
+use ExtUtils::MakeMaker;
+
+my %INFOS = (
+    'NAME'	=> 'Cluster::CCS',
+    'VERSION_FROM' => 'CCS.pm', # finds $VERSION
+    'AUTHOR'	=> 'Fabio M. Di Nitto <[email protected]>',
+    'ABSTRACT'	=> 'Interface to Cluster Configuration Service library',
+);
+
+# read extra configurations from the commandline
+my %params;
+ at params{qw(DEBUG DEFINE EXTRALIBDIR GDOME INC LIBS SKIP_SAX_INSTALL XMLPREFIX)}=();
+
+ at ARGV = grep {
+  my ($key, $val) = split(/=/, $_, 2);
+  if (exists $params{$key}) {
+    $config{$key} = $val; 0
+  } else { 1 }
+} @ARGV;
+
+$extralibdir = $config{EXTRALIBDIR};
+delete $config{EXTRALIBDIR};
+
+WriteMakefile(
+              %INFOS,
+              %config,
+);
+
bindings/perl/ccs/test.pl new file +20 -0
new file mode 100644
index 0000000..64d740d
@@ -0,0 +1,20 @@
+# Before `make install' is performed this script should be runnable with
+# `make test'. After `make install' it should work as `perl test.pl'
+
+######################### We start with some black magic to print on failure.
+
+# Change 1..1 below to 1..last_test_to_print .
+# (It may become useful if the test is moved to ./t subdirectory.)
+
+BEGIN { $| = 1; print "1..1\n"; }
+END {print "not ok 1\n" unless $loaded;}
+use Cluster::CCS;
+$loaded = 1;
+print "ok 1\n";
+
+######################### End of black magic.
+
+# Insert your test code below (better if it prints "ok 13"
+# (correspondingly "not ok 13") depending on the success of chunk 13
+# of the test code):
+
bindings/perl/ccs/typemap new file +14 -0
new file mode 100644
index 0000000..267d1e5
@@ -0,0 +1,14 @@
+TYPEMAP
+unsigned int *    T_PTROBJ
+char **           T_PTROBJ
+int *             T_PTROBJ
+char const *      T_PTROBJ
+struct sockaddr_in * T_sockaddr_in
+
+INPUT
+T_sockaddr_in
+    $var = ($type)SvPV($arg,na)
+
+OUTPUT
+T_sockaddr_in
+    sv_setpvn($arg, (char *)$var, sizeof(struct sockaddr_in));
configure +7 -0
index ae90287..72053a6 100755
@@ -387,6 +387,13 @@ if (! -d "$objdir/make") {
   symlinks("gnbd-kernel","*.h");
   symlinks("gfs-kernel","*.c");
   symlinks("gfs-kernel","*.h");
+  symlinks("bindings","*.pl");
+  symlinks("bindings","*.pm");
+  symlinks("bindings","*.xs");
+  symlinks("bindings","*.PL");
+  symlinks("bindings","MANIFEST");
+  symlinks("bindings","META.yml");
+  symlinks("bindings","typemap");
 } else {
   print "nothing to do\n";
 }