summaryrefslogtreecommitdiff
path: root/bindings/perl
diff options
context:
space:
mode:
Diffstat (limited to 'bindings/perl')
-rw-r--r--bindings/perl/CMakeLists.txt49
-rw-r--r--bindings/perl/lib/CMakeLists.txt2
-rw-r--r--bindings/perl/lib/Libproxy.pm75
-rw-r--r--bindings/perl/src/CMakeLists.txt25
-rw-r--r--bindings/perl/src/Libproxy.xs98
-rw-r--r--bindings/perl/src/doxsubpp.pl23
-rw-r--r--bindings/perl/src/typemap2
-rw-r--r--bindings/perl/t/CMakeLists.txt2
-rw-r--r--bindings/perl/t/Libproxy.t15
9 files changed, 0 insertions, 291 deletions
diff --git a/bindings/perl/CMakeLists.txt b/bindings/perl/CMakeLists.txt
deleted file mode 100644
index 368bc56..0000000
--- a/bindings/perl/CMakeLists.txt
+++ /dev/null
@@ -1,49 +0,0 @@
-find_package(Perl)
-include (FindPerlLibs)
-
-if(PERL_FOUND AND PERLLIBS_FOUND)
-
- # Enable override of perl packge install directory.
- set(PX_PERL_ARCH ${PX_PERL_ARCH} CACHE PATH "Install directory for Perl package.")
-
- if(NOT PX_PERL_ARCH)
- # Some distributions install perl packages in vendor when shipped with the distro.
- # Let's make their lifes easier by offering an install flag for this usecase.
- option(PERL_VENDORINSTALL "Install Perl package in vendor directory" OFF)
-
- # Offer an option to explicitly link against libperl.so, with a default
- # that depends on the value of the PERL_VENDORINSTALL option: if the
- # binding is installed into a version-independent directory such as
- # vendor_perl the chances of it needing a rebuild on each Perl update are
- # lower. Note: not linking against libperl.so does not work if
- # --no-undefined is passed to the linker.
- if(PERL_VENDORINSTALL)
- option(PERL_LINK_LIBPERL "Explicitly link against libperl.so" OFF)
- else()
- option(PERL_LINK_LIBPERL "Explicitly link against libperl.so" ON)
- endif()
-
- if(PERL_VENDORINSTALL)
- set (PX_PERL_ARCH ${PERL_VENDORARCH})
- set (PX_PERL_LIB ${PERL_VENDORLIB})
- else()
- # PERL_SITEARCH is actually not defined in latest FindPerlLibs.cmake macros, thus
- # we have to find the correct path on our own.
- EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{sitearch}"
- OUTPUT_VARIABLE PX_PERL_ARCH)
- set (PX_PERL_LIB ${PERL_SITELIB})
- endif()
-
- # PERL_EXTRA_C_FLAGS is not complete, we need full flags (including e.g.
- # _FILE_OFFSET_BITS=64) for compatibility.
- EXECUTE_PROCESS(COMMAND ${PERL_EXECUTABLE} -MConfig -e "print \$Config{ccflags}"
- OUTPUT_VARIABLE PX_PERL_CCFLAGS)
- # Convert it to a "list" suitable for target_compile_options.
- string(REPLACE " " ";" PX_PERL_CCFLAGS ${PX_PERL_CCFLAGS})
- endif()
-
- add_subdirectory(lib)
- add_subdirectory(src)
- add_subdirectory(t)
-endif()
-
diff --git a/bindings/perl/lib/CMakeLists.txt b/bindings/perl/lib/CMakeLists.txt
deleted file mode 100644
index 7c36e51..0000000
--- a/bindings/perl/lib/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-add_custom_target(PMlibproxy ALL ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.pm ${CMAKE_BINARY_DIR}/perl/Net/Libproxy.pm)
-install( FILES Libproxy.pm DESTINATION ${PX_PERL_ARCH}/Net )
diff --git a/bindings/perl/lib/Libproxy.pm b/bindings/perl/lib/Libproxy.pm
deleted file mode 100644
index 67670fe..0000000
--- a/bindings/perl/lib/Libproxy.pm
+++ /dev/null
@@ -1,75 +0,0 @@
-package Net::Libproxy;
-use 5.008000;
-use warnings;
-our $VERSION = '0.04';
-
-require Exporter;
-require DynaLoader;
-@ISA = qw(Exporter DynaLoader);
-@EXPORT = qw(proxy_factory_new proxy_factory_get_proxies);
-
-bootstrap Net::Libproxy;
-
-sub new {
- my $self;
-
- $self->{pf} = Net::Libproxy::proxy_factory_new();
-
- bless $self;
-}
-
-sub getProxies {
- my ($self, $url) = @_;
-
- return Net::Libproxy::proxy_factory_get_proxies($self->{pf}, $url);
-}
-
-1;
-
-
-=head1 NAME
-
-Net::Libproxy - Perl binding for libproxy ( http://code.google.com/p/libproxy/ )
-
-=head1 SYNOPSIS
-
- use Net::Libproxy;
-
- $p = new Net::Libproxy;
- $proxies = $p->getProxies('http://code.google.com/p/libproxy/');
-
- foreach my $proxy (@$proxies) {
- print $proxy."\n";
- }
-
-=head1 DESCRIPTION
-
-libproxy is a lightweight library which makes it easy to develop
-applications proxy-aware with a simple and stable API.
-
-=head2 EXPORT
-
-These two functions are also exported.
-proxy_factory_new()
-proxy_factory_get_proxies()
-
-=head1 SEE ALSO
-
-Libproxy homepage: http://code.google.com/p/libproxy/
-Net::Libproxy on Gitorious: http://gitorious.org/net-libproxy
-You can also read proxy.h and Net/Libproxy.pm
-
-=head1 AUTHOR
-
-Goneri Le Bouder, E<lt>goneri@rulezlan.orgE<gt>
-
-=head1 COPYRIGHT AND LICENSE
-
-Copyright (C) 2009 by Goneri Le Bouder
-
-This library is free software; you can redistribute it and/or modify
-it under the same terms as Perl itself, either Perl version 5.10.0 or,
-at your option, any later version of Perl 5 you may have available.
-
-
-=cut
diff --git a/bindings/perl/src/CMakeLists.txt b/bindings/perl/src/CMakeLists.txt
deleted file mode 100644
index 2800a85..0000000
--- a/bindings/perl/src/CMakeLists.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-include_directories( ${PERL_INCLUDE_PATH} ${CMAKE_SOURCE_DIR}/libproxy )
-
-# Run doxsubpp.pl to run xsubpp on Libproxy.xs
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/Libproxy.c
- COMMAND ${PERL_EXECUTABLE} ARGS ${CMAKE_CURRENT_SOURCE_DIR}/doxsubpp.pl
- ${PERL_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.xs ${CMAKE_CURRENT_BINARY_DIR}/Libproxy.c
- DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/Libproxy.xs libproxy
- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
-
-set(Libproxy_LIB_SRCS Libproxy.c)
-
-set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/perl/auto/Net/Libproxy)
-add_library(PLlibproxy SHARED ${Libproxy_LIB_SRCS})
-
-set(PLlibproxy_LIB_DEPENDENCIES libproxy pthread)
-if(PERL_LINK_LIBPERL)
- set(PLlibproxy_LIB_DEPENDENCIES ${PERL_LIBRARY} ${PLlibproxy_LIB_DEPENDENCIES})
-endif()
-
-target_link_libraries(PLlibproxy ${PLlibproxy_LIB_DEPENDENCIES})
-target_compile_options(PLlibproxy PRIVATE ${PX_PERL_CCFLAGS})
-set_target_properties(PLlibproxy PROPERTIES OUTPUT_NAME "Libproxy")
-set_target_properties(PLlibproxy PROPERTIES PREFIX "")
-
-install( TARGETS PLlibproxy DESTINATION ${PX_PERL_ARCH}/auto/Net/Libproxy )
diff --git a/bindings/perl/src/Libproxy.xs b/bindings/perl/src/Libproxy.xs
deleted file mode 100644
index bf5c2bb..0000000
--- a/bindings/perl/src/Libproxy.xs
+++ /dev/null
@@ -1,98 +0,0 @@
-#include "EXTERN.h"
-#include "perl.h"
-#include "XSUB.h"
-
-#include <proxy.h>
-
-
-void XS_pack_charPtrPtr( SV * arg, char ** array, int count) {
- int i;
- AV * avref;
- avref = (AV*)sv_2mortal((SV*)newAV());
- for (i=0; i<count; i++) {
- av_push(avref, newSVpv(array[i], strlen(array[i])));
- }
- SvSetSV( arg, newRV((SV*)avref));
-}
-
-/* http://www.perlmonks.org/?node_id=680842 */
-static char **
-XS_unpack_charPtrPtr (SV *arg) {
- char **ret;
- AV *av;
- I32 i;
-
- if (!arg || !SvOK (arg) || !SvROK (arg) || SvTYPE (SvRV (arg)) != SVt_PVAV)
- croak ("array reference expected");
-
- av = (AV *)SvRV (arg);
- ret = malloc ((av_len (av) + 1 + 1) * sizeof (char *));
- if (!ret)
- croak ("malloc failed");
-
- for (i = 0; i <= av_len (av); i++) {
- SV **elem = av_fetch (av, i, 0);
-
- if (!elem || !*elem) {
- free (ret);
- croak ("missing element in list");
- }
-
- ret[i] = SvPV_nolen (*elem);
- }
-
- ret[i] = NULL;
-
- return ret;
-}
-
-
-MODULE = Net::Libproxy PACKAGE = Net::Libproxy
-
-PROTOTYPES: DISABLE
-
-pxProxyFactory *
-proxy_factory_new()
- PREINIT:
- pxProxyFactory *pf;
- CODE:
- pf = px_proxy_factory_new();
- RETVAL = pf;
- OUTPUT:
- RETVAL
-
-char **
-proxy_factory_get_proxies(pf, url)
- pxProxyFactory * pf
- char * url
- PREINIT:
- char ** array;
- int count_charPtrPtr;
- int i;
- CODE:
- array = px_proxy_factory_get_proxies(pf, url);
- RETVAL = array;
- i = 0;
- while( array[i] != NULL ) {
- i++;
- }
- count_charPtrPtr = i;
- OUTPUT:
- RETVAL
-
-void
-proxy_factory_free_proxies(proxies)
- char ** proxies
- CODE:
- px_proxy_factory_free_proxies(proxies);
-
-MODULE = Net::Libproxy PACKAGE = Net::Libproxy::ProxyFactoryPtr
-
-void
-DESTROY(pf)
- pxProxyFactory * pf
- CODE:
- printf("Net::Libproxy::DESTROY\n");
- px_proxy_factory_free(pf);
-
-
diff --git a/bindings/perl/src/doxsubpp.pl b/bindings/perl/src/doxsubpp.pl
deleted file mode 100644
index 57ab4dd..0000000
--- a/bindings/perl/src/doxsubpp.pl
+++ /dev/null
@@ -1,23 +0,0 @@
-use strict;
-use warnings;
-use ExtUtils::MakeMaker;
-
-my $perl = $ARGV[0];
-my $in = $ARGV[1];
-my $out = $ARGV[2];
-
-my $mm = ExtUtils::MakeMaker->new( {
- NAME => 'Libproxy',
- NEEDS_LINKING => 1,
-} );
-
-my $perl_include_path = $mm->{PERL_INC};
-my @xsubinfo = split "\n", $mm->tool_xsubpp();
-
-my $xsubppdir = (map{ my $foo = $_; $foo =~ s/XSUBPPDIR = //; $foo } grep{ m/^XSUBPPDIR =/ } @xsubinfo)[0];
-my $xsubpp = "$xsubppdir/xsubpp";
-
-my $xsubppargs = (map{ my $foo = $_; $foo =~ s/XSUBPPARGS = //; $foo } grep{ m/^XSUBPPARGS =/ } @xsubinfo)[0];
-
-my $cmd = "$perl $xsubpp $xsubppargs -typemap typemap $in > $out";
-system $cmd;
diff --git a/bindings/perl/src/typemap b/bindings/perl/src/typemap
deleted file mode 100644
index 62be990..0000000
--- a/bindings/perl/src/typemap
+++ /dev/null
@@ -1,2 +0,0 @@
-TYPEMAP
-pxProxyFactory * T_PTROBJ
diff --git a/bindings/perl/t/CMakeLists.txt b/bindings/perl/t/CMakeLists.txt
deleted file mode 100644
index cb18fd3..0000000
--- a/bindings/perl/t/CMakeLists.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-add_test(NAME perl COMMAND prove -b ${CMAKE_CURRENT_SOURCE_DIR})
-set_property(TEST perl APPEND PROPERTY ENVIRONMENT "PERL5LIB=${CMAKE_BINARY_DIR}/perl")
diff --git a/bindings/perl/t/Libproxy.t b/bindings/perl/t/Libproxy.t
deleted file mode 100644
index 5c4fe61..0000000
--- a/bindings/perl/t/Libproxy.t
+++ /dev/null
@@ -1,15 +0,0 @@
-# Before `make install' is performed this script should be runnable with
-# `make test'. After `make install' it should work as `perl Foo.t'
-
-#########################
-
-# change 'tests => 1' to 'tests => last_test_to_print';
-
-use Test::More tests => 1;
-BEGIN { use_ok('Net::Libproxy') };
-
-#########################
-
-# 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.
-