From 94810222866b7cc36bf442993826f9b38dbe9c41 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Sun, 15 Oct 2006 19:38:02 +0000 Subject: Final frugalware changes commit --- bindings/perl/Makefile.in | 42 ++++++++++++++++++++++++++++++++++++++++++ bindings/perl/alpm.i | 23 +++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 bindings/perl/Makefile.in create mode 100644 bindings/perl/alpm.i (limited to 'bindings/perl') diff --git a/bindings/perl/Makefile.in b/bindings/perl/Makefile.in new file mode 100644 index 00000000..9ebc2d5d --- /dev/null +++ b/bindings/perl/Makefile.in @@ -0,0 +1,42 @@ +top_srcdir = @top_srcdir@ +prefix = @prefix@ + +CFLAGS = $(subst -Werror,,@CFLAGS@) +CFLAGS += $(shell perl -MExtUtils::Embed -e ccopts) +CFLAGS += -I$(top_srcdir)/lib/libalpm +ifeq ($(shell arch),x86_64) +CFLAGS += -fPIC +endif +LDFLAGS += -L$(top_srcdir)/lib/libalpm -lalpm +LIBDIR += $(shell perl -V|grep site|sed 's/^ *//;s|/usr|$(prefix)|;q') + +all: Core.so + +Core.so: alpm_wrap.o + $(CC) -shared -Wl,-soname,$@ -o $@ $^ $(LDFLAGS) + +alpm_wrap.o: alpm_wrap.c + $(CC) $(CFLAGS) -c -o $@ -include alpm.h $^ + +alpm_wrap.c: + cp $(top_srcdir)/lib/libalpm/alpm.h ./ + cp $(top_srcdir)/bindings/alpm.i ./ + swig -perl alpm.i + +install: install-so install-pm + +install-so: Core.so + mkdir -p $(DESTDIR)$(LIBDIR)/auto/Alpm/Core + install $^ $(DESTDIR)$(LIBDIR)/auto/Alpm/Core/ + +install-pm: Core.pm + mkdir -p $(DESTDIR)$(LIBDIR)/Alpm/ + install -m644 $^ $(DESTDIR)$(LIBDIR)/Alpm/ + +clean: + rm -f Core* alpm{.h,_wrap*} + +distclean: clean + rm -f Makefile + +check: diff --git a/bindings/perl/alpm.i b/bindings/perl/alpm.i new file mode 100644 index 00000000..dc4d680e --- /dev/null +++ b/bindings/perl/alpm.i @@ -0,0 +1,23 @@ +#if defined(SWIGPERL) +%module "Alpm::Core" +#else +%module alpm +#endif +%include "cpointer.i" + +/* Wrap a class interface around a "long *" */ +%pointer_class(long, longp); + +/* Create casting functions */ + +%pointer_cast(char *, long *, void_to_long); +%pointer_cast(void *, char *, void_to_char); +%pointer_cast(void *, unsigned long, void_to_unsigned_long); +%pointer_cast(void *, PM_LIST *, void_to_PM_LIST); +%pointer_cast(void *, PM_PKG *, void_to_PM_PKG); +%pointer_cast(void *, PM_GRP *, void_to_PM_GRP); +%pointer_cast(void *, PM_SYNCPKG *, void_to_PM_SYNCPKG); +%pointer_cast(void *, PM_DB *, void_to_PM_DB); +%pointer_cast(void *, PM_CONFLICT *, void_to_PM_CONFLICT); + +%include "alpm.h" -- cgit v1.2.3-70-g09d2