This is the mail archive of the cluster-cvs@sourceware.org mailing list for the cluster.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

cluster: master - build: re-enable perl CCS bindings


Gitweb:        http://git.fedorahosted.org/git/cluster.git?p=cluster.git;a=commitdiff;h=bb16c9f25e8a3a43854f091c6c38af726aaa259c
Commit:        bb16c9f25e8a3a43854f091c6c38af726aaa259c
Parent:        f300faa3d74e2422f7224d7e5559d77c139e239b
Author:        Fabio M. Di Nitto <fdinitto@redhat.com>
AuthorDate:    Fri May 29 15:07:38 2009 +0200
Committer:     Fabio M. Di Nitto <fdinitto@redhat.com>
CommitterDate: Fri May 29 15:07:38 2009 +0200

build: re-enable perl CCS bindings

this works for the general build/install case. Still fails
distcheck because of MakeMaker understanding of $(prefix).

Signed-off-by: Fabio M. Di Nitto <fdinitto@redhat.com>
---
 bindings/perl/Makefile.am           |    2 +-
 bindings/perl/ccs/CCS.pm.in         |    2 +-
 bindings/perl/ccs/META.yml.in       |    2 +-
 bindings/perl/ccs/Makefile.am       |   59 +++++++++++++++++++++++++++++++++++
 bindings/perl/ccs/Makefile.bindings |   13 --------
 configure.ac                        |    1 +
 6 files changed, 63 insertions(+), 16 deletions(-)

diff --git a/bindings/perl/Makefile.am b/bindings/perl/Makefile.am
index ced84b5..5d953b3 100644
--- a/bindings/perl/Makefile.am
+++ b/bindings/perl/Makefile.am
@@ -1,3 +1,3 @@
 MAINTAINERCLEANFILES	= Makefile.in
 
-SUBDIRS			= #ccs
+SUBDIRS			= ccs
diff --git a/bindings/perl/ccs/CCS.pm.in b/bindings/perl/ccs/CCS.pm.in
index 97a3a87..1dc5c24 100644
--- a/bindings/perl/ccs/CCS.pm.in
+++ b/bindings/perl/ccs/CCS.pm.in
@@ -18,7 +18,7 @@ our %EXPORT_TAGS = ( 'all' => [qw(
 );
 @EXPORT_OK = (@{$EXPORT_TAGS{'all'}});
 
-our $VERSION = '@VERSION@';
+our $VERSION = '_VERSION_';
 
 require XSLoader;
 XSLoader::load('Cluster::CCS', $VERSION);
diff --git a/bindings/perl/ccs/META.yml.in b/bindings/perl/ccs/META.yml.in
index 32ae9a3..0bde4d4 100644
--- a/bindings/perl/ccs/META.yml.in
+++ b/bindings/perl/ccs/META.yml.in
@@ -1,6 +1,6 @@
 --- #YAML:1.0
 name:                Cluster-CCS
-version:             @VERSION@
+version:             _VERSION_
 abstract:            ~
 license:             ~
 author:              
diff --git a/bindings/perl/ccs/Makefile.am b/bindings/perl/ccs/Makefile.am
new file mode 100644
index 0000000..1fa5dcd
--- /dev/null
+++ b/bindings/perl/ccs/Makefile.am
@@ -0,0 +1,59 @@
+MAINTAINERCLEANFILES	= Makefile.in
+
+PERL_TARGET 		= CCS.pm META.yml
+
+PERL_MAKEFILE		= Makefile.perl
+
+PERL_MAKEFILEPL		= Makefile.PL
+
+LINK_SRCS		= CCS.xs typemap test.pl
+
+EXTRA_DIST		= $(PERL_MAKEFILE_PL) $(LINK_SRCS) \
+			  CCS.pm.in META.yml.in
+
+AM_CPPFLAGS		= -I$(top_srcdir)/config/libs/libccsconfdb/
+
+AM_LDFLAGS		= -L$(top_builddir)/config/libs/libccsconfdb/.libs -lccs
+
+all-local: linkcode $(PERL_MAKEFILE) $(PERL_TARGET)
+	${MAKE} -f $(PERL_MAKEFILE) LD_RUN_PATH="";
+
+%.pm: $(srcdir)/%.pm.in
+	cat $< | \
+	sed \
+		-e 's/_VERSION_/${PACKAGE_VERSION}/g' \
+	> $@
+
+%.yml: $(srcdir)/%.yml.in
+	cat $< | \
+	sed \
+		-e 's/_VERSION_/${PACKAGE_VERSION}/g' \
+	> $@
+
+$(PERL_MAKEFILE): linkcode $(PERL_TARGET) Makefile
+	perl $(PERL_MAKEFILEPL) \
+		FIRST_MAKEFILE=$@ \
+		INC='$(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)' \
+		LIBS='$(AM_LDFLAGS) $(LDFLAGS)' \
+		INSTALLDIRS=vendor
+
+linkcode:
+	if [ ! -e $(PERL_MAKEFILEPL) ]; then \
+		for i in $(PERL_MAKEFILEPL) $(LINK_SRCS); do \
+			$(LN_S) $(srcdir)/$$i $$i; \
+		done; \
+		touch linkcode; \
+	fi
+
+clean-local:
+	-${MAKE} -f $(PERL_MAKEFILE) clean
+	rm -f $(PERL_TARGET) *.old
+	if [ -e linkcode ]; then \
+		rm -f $(PERL_MAKEFILEPL) $(LINK_SRCS) linkcode; \
+	fi
+
+install-exec-local:
+	${MAKE} -f $(PERL_MAKEFILE) install ;
+
+uninstall-local:
+	echo "MakeMaker does not support uninstall."
diff --git a/bindings/perl/ccs/Makefile.bindings b/bindings/perl/ccs/Makefile.bindings
deleted file mode 100644
index 9818a89..0000000
--- a/bindings/perl/ccs/Makefile.bindings
+++ /dev/null
@@ -1,13 +0,0 @@
-include ../../../make/defines.mk
-
-PMTARGET = CCS.pm
-
-TARGET = $(PMTARGET)
-
-CFLAGS += -I${ccsincdir}
-CFLAGS += -I${incdir}
-
-LDFLAGS += -L${ccslibdir} -lccs
-LDFLAGS += -L${libdir}
-
-include $(OBJDIR)/make/perl-binding-common.mk
diff --git a/configure.ac b/configure.ac
index 8900b1a..1710108 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,7 @@ AC_CONFIG_FILES([Makefile
 		 doc/Makefile
 		 bindings/Makefile
 		 bindings/perl/Makefile
+		 bindings/perl/ccs/Makefile
 		 ])
 
 AC_OUTPUT


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]