Skip to content

Commit

Permalink
Make compatible with newer libcouchbase versions (with less deps)
Browse files Browse the repository at this point in the history
- Fixed bundled building (user can force this even if libcouchbase is
  installed)

- Removed libisasl build process (libisasl is now shipped with
  libcouchbase)

- Removed memcached headers extraction (this too is shipped with
  libcouchbase)
  • Loading branch information
mnunberg committed Jul 3, 2012
1 parent 3e117b7 commit 836832c
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 29 deletions.
1 change: 0 additions & 1 deletion MANIFEST.in
Expand Up @@ -61,7 +61,6 @@ t/tmp/CouchbaseMock.jar
src/Makefile.PL
src/libcouchbase.pm

src/memcached-headers.tar.gz
src/libcouchbase-__LIBCOUCHBASE_RELEASE__.tar.gz
src/libvbucket-__LIBVBUCKET_RELEASE__.tar.gz
src/libevent-__LIBEVENT_RELEASE__.tar.gz
3 changes: 2 additions & 1 deletion Makefile.PL
Expand Up @@ -18,9 +18,10 @@ $ENV{LD_RUN_PATH} ||= "";

#$Verbose = 99;

our $Bundled = 0;
GetOptions(
'dynamic' => \my $UseDynamic,
'bundled' => \my $UseBundled,
'bundled' => \$Bundled,
'incpath=s' => \our $U_IncPath,
'libpath=s' => \our $U_LibPath
) or die <<EOD;
Expand Down
5 changes: 2 additions & 3 deletions PLCB_Config.pm
Expand Up @@ -15,10 +15,9 @@ my $params = {
'perl-Couchbase-Client/CouchbaseMock-0.5-SNAPSHOT.jar',

#version numbers for libcouchbase and libvbucket
LIBVBUCKET_RELEASE => '1.8.0.2',
LIBCOUCHBASE_RELEASE => '1.0.0_75_g5622928',
LIBVBUCKET_RELEASE => '1.8.0.4',
LIBCOUCHBASE_RELEASE => '1.0.4',

#LIBISASL_RELEASE => '1.0.0_3_g35e33e3',
LIBEVENT_RELEASE => '2.0.17-stable',
};

Expand Down
8 changes: 0 additions & 8 deletions build_libraries.pl
Expand Up @@ -76,7 +76,6 @@ sub tarball_2_dir {
my $LIBVBUCKET_TARBALL = lib_2_tarball('libvbucket');
my $LIBCOUCHBASE_TARBALL = lib_2_tarball('libcouchbase');
my $LIBEVENT_TARBALL = lib_2_tarball('libevent');
my $MEMCACHED_H_TARBALL = "memcached-headers.tar.gz";

################################################################################
################################################################################
Expand All @@ -94,13 +93,6 @@ sub tarball_2_dir {
mkpath($INCLUDE_PATH);
mkpath($LIB_PATH);

runcmd("tar xzf $MEMCACHED_H_TARBALL");
rmtree(File::Spec->catfile($INCLUDE_PATH, 'memcached'));
runcmd("mv include/memcached $INCLUDE_PATH && rm -rf include/memcached");
unless(-e File::Spec->catfile($INCLUDE_PATH, 'memcached', 'protocol_binary.h')) {
die("Can't extract memcached headers");
}

$ENV{PKG_CONFIG_PATH} .= ":"
. File::Spec->catfile($INST_DIR, 'lib', 'pkgconfig');
#$ENV{CC} = $Config{cc};
Expand Down
21 changes: 5 additions & 16 deletions src/Makefile.PL
Expand Up @@ -72,21 +72,17 @@ return 1;
EOC

my $LIBSASL_CFUNC = <<EOC;
#include <stdlib.h>
sasl_server_init(NULL, NULL);
return 0;
EOC

sub check_dependency {
my ($names,$fn,%extra) = @_;
$names = ref $names ? $names : [ $names ];

print STDERR "\nChecking for @{$names}...\n";
local %ENV = %ENV;

if ($PLCBTopLevel::Bundled) {
return 0;
}

foreach my $libname (@$names) {
my (undef,undef,$ldargs,$runpath,$sofile) =
ExtUtils::Liblist->ext("$SEARCHPATH_S -l$libname", 0, 1);
Expand Down Expand Up @@ -297,7 +293,7 @@ sub MM_Configure {

if($ENV{PLCB_BUILD_ALL}) {
log_err('build_all reuqested');
@to_build = qw(VBUCKET COUCHBASE EVENT ISASL);
@to_build = qw(VBUCKET COUCHBASE EVENT);
goto GT_MANGLE;
}

Expand All @@ -318,13 +314,6 @@ sub MM_Configure {
'event', $LIBEVENT_CFUNC, header => ['event.h', 'stdio.h'] )) {
push @to_build, 'EVENT';
}


if(0 && !check_dependency(
['sasl2', 'sasl'], $LIBSASL_CFUNC,
header => [ 'stdlib.h', 'sasl/sasl.h'] )) {
push @to_build, 'ISASL';
}

GT_MANGLE:
my $errmsg = "\n".
Expand Down

0 comments on commit 836832c

Please sign in to comment.