Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Updated to newer version of libisasl

and fixed some more bugs in the ac scripts
  • Loading branch information...
commit e067c89f8e36d41357b2997b847aa3c95fc36ba5 1 parent 9c6277d
@mnunberg mnunberg authored
View
2  MANIFEST
@@ -64,4 +64,4 @@ src/memcached-headers.tar.gz
src/libcouchbase-1.0.1.tar.gz
src/libvbucket-1.8.0.2.tar.gz
src/libevent-2.0.17-stable.tar.gz
-src/libisasl-1.0.0_2_gc3f3496.tar.gz
+src/libisasl-1.0.0_3_g35e33e3.tar.gz
View
25 Makefile.PL
@@ -61,14 +61,14 @@ $MM_Options{CONFIGURE} = sub {
my @C_Modules = qw(
callbacks convert ctor async_base async_callbacks async_events);
my @XS_Modules = qw(Client Client_multi);
-
+
foreach (@XS_Modules, @C_Modules) {
my $obj = $_ . $Config{obj_ext};
push @{ $MM_Options{OBJECT} }, File::Spec->catfile('xs', $obj);
}
-
+
$MM_Options{OBJECT} = join(' ', @{$MM_Options{OBJECT}});
-
+
foreach my $xs (@XS_Modules) {
$xs = File::Spec->catfile('xs', $xs);
my $c = "$xs.c";
@@ -105,11 +105,11 @@ WriteMakefile(
AUTHOR => q{M. Nunberg <mnunberg@haskalah.org>},
VERSION_FROM => 'lib/Couchbase/Client.pm',
ABSTRACT_FROM => 'lib/Couchbase/Client.pm',
-
+
($ExtUtils::MakeMaker::VERSION >= 6.3002
? ('LICENSE'=> 'perl')
- : ()),
-
+ : ()),
+
CONFIGURE_REQUIRES => {
'Dir::Self' => 0,
},
@@ -119,21 +119,18 @@ WriteMakefile(
'ExtUtils::H2PM' => 0.08,
'Class::XSAccessor' => 1.11,
'Test::More' => 0,
-
- #We need libevent for whatever we're doing
- 'Alien::Libevent' => 0.001004,
-
+
#These modules are needed for tests, but not strictly required for
#functionality
-
+
'Log::Fu' => 0.25,
'Test::Class' => 0.36,
-
+
#these are needed for asynchronous tests and modules
'POE::Sugar::Attributes' => 0.02,
'POE' => 1.312,
},
-
+
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Couchbase-Client-* COMPILER_FLAGS' },
%MM_Options,
@@ -169,4 +166,4 @@ sub libscan {
} else {
return $path;
}
-}
+}
View
2  PLCB_Config.pm
@@ -18,7 +18,7 @@ my $params = {
LIBVBUCKET_RELEASE => '1.8.0.2',
LIBCOUCHBASE_RELEASE => '1.0.1',
- LIBISASL_RELEASE => '1.0.0_2_gc3f3496',
+ LIBISASL_RELEASE => '1.0.0_3_g35e33e3',
LIBEVENT_RELEASE => '2.0.17-stable',
};
View
28 build_libraries.pl
@@ -49,6 +49,7 @@ sub runcmd {
print STDERR "Command $cmd failed\n";
printf STDERR ("CPPFLAGS=%s\nLDFLAGS=%s\n", $ENV{CPPFLAGS}, $ENV{LDFLAGS});
printf STDERR ("LD_RUN_PATH=%s\n", $ENV{LD_RUN_PATH});
+ printf STDERR ("LIBS=%s\n", $ENV{LIBS});
die "";
}
}
@@ -166,7 +167,7 @@ sub lib_is_built {
--disable-debug-mode
), @COMMON_OPTIONS
);
-
+
chdir tarball_2_dir($LIBEVENT_TARBALL);
runcmd("./configure", @libevent_options) unless -e 'Makefile';
log_info("Configured libevent");
@@ -185,13 +186,13 @@ sub lib_is_built {
runcmd("./configure", @COMMON_OPTIONS);
log_info("Configured libvbucket");
}
-
+
runcmd("$MAKEPROG");
log_info("build libvbucket");
runcmd("$MAKEPROG install");
log_info("installed libvbucket");
runcmd("$MAKEPROG check") if $RUN_TESTS;
- log_info("tested libvbucket");
+ log_info("tested libvbucket");
}
@@ -203,22 +204,22 @@ sub lib_is_built {
{
chdir $TOPLEVEL;
chdir tarball_2_dir($LIBCOUCHBASE_TARBALL);
-
+
my @libcouchbase_options = (
@COMMON_OPTIONS,
"--disable-tools",
"--enable-embed-libevent-plugin",
);
-
+
if($^O =~ /solaris/) {
print STDERR "Disabling tools (won't compile on solaris)\n";
push @libcouchbase_options, '--disable-tools';
}
-
+
my $have_java = eval { runcmd("java", "-version"); 1; };
my $mockpath = File::Spec->catfile(
__DIR__, 't', 'tmp', 'CouchbaseMock.jar');
-
+
if(!-e $mockpath) {
die("Can't find mock in $mockpath");
}
@@ -227,7 +228,7 @@ sub lib_is_built {
} else {
push @libcouchbase_options, '--disable-couchbasemock';
}
-
+
#First, we need to mangle the 'configure' script:
{
my @conflines;
@@ -237,17 +238,20 @@ sub lib_is_built {
if($line =~ s/LIBS=(-l\S+)/LIBS="\$LIBS $1"/msg) {
print STDERR ">> REPLACING: $line";
}
+ if($line =~ s/sasl_server_init\(NULL,/sasl_client_init\(/) {
+ print STDERR ">> REPLACING: $line";
+ }
}
seek($confh, 0, 0);
print $confh @conflines;
truncate($confh, tell($confh));
-
+
close($confh);
}
-
- runcmd("./configure", @libcouchbase_options) unless -e 'Makefile';
+
+ runcmd("./configure", @libcouchbase_options) unless -e 'Makefile';
runcmd("$MAKEPROG install");
runcmd("$MAKEPROG check -s") if $RUN_TESTS;
}
-exit(0);
+exit(0);
View
2  lib/Couchbase/Client.pm
@@ -2,7 +2,7 @@ package Couchbase::Client;
BEGIN {
require XSLoader;
- our $VERSION = '0.13_0';
+ our $VERSION = '0.14_0';
XSLoader::load(__PACKAGE__, $VERSION);
}
View
2  lib/Couchbase/Client/Async.pm
@@ -1,7 +1,7 @@
package Couchbase::Client::Async;
use strict;
use warnings;
-our $VERSION = '0.13_0';
+our $VERSION = '0.14_0';
require XSLoader;
XSLoader::load('Couchbase::Client', $VERSION);
use Couchbase::Client;
View
124 src/Makefile.PL
@@ -51,12 +51,16 @@ return 1;
EOC
my $LIBEVENT_CFUNC = <<EOC;
+
int version_major = 0, version_minor = 0;
+
const char *version_string = event_get_version();
if(!version_string) {
return 1;
}
+
sscanf(version_string, "%d.%d", &version_major, &version_minor);
+
if(version_major >= 2) {
return 0;
} else if(version_major == 1 && version_minor >= 4) {
@@ -66,8 +70,13 @@ return 1;
EOC
-#sub have_
+my $LIBSASL_CFUNC = <<EOC;
+#include <stdlib.h>
+sasl_server_init(NULL, NULL);
+return 0;
+
+EOC
sub check_dependency {
my ($names,$fn,%extra) = @_;
@@ -78,20 +87,21 @@ sub check_dependency {
foreach my $libname (@$names) {
my (undef,undef,$ldargs,$runpath,$sofile) =
ExtUtils::Liblist->ext("$SEARCHPATH_S -l$libname", 0, 1);
-
+
next unless ($sofile && ($sofile = $sofile->[0]) );
-
+
log_info("Have:", $sofile);
my %cl_opts = (
%CHECKLIB_OPTIONS,
lib => $libname,
+ debug => 1,
#libpath => "-Wl,$ldargs,$sofile",
);
-
+
if($runpath) {
$ENV{LD_RUN_PATH} .= $runpath;
}
-
+
if($fn) {
$cl_opts{function} = $fn;
}
@@ -120,13 +130,13 @@ sub insert_announcement {
sub create_buildscript_invocation {
my ($mm,$build,$install,$deps) = @_;
-
+
#mm is the parent Makefile, here
-
+
my @lines = (
-
+
#begin long commandline invocation:
-
+
"\t".
#'$(NOECHO) $(ECHO) '.
'$(PERLRUN) ' .
@@ -134,27 +144,27 @@ sub create_buildscript_invocation {
"\t\t".sprintf(" --build-prefix=%s \\\n\t\t--install-prefix=%s",
$mm->quote_literal($build),
$mm->quote_literal($install)) . "\\",
-
+
"\t\t".sprintf(" --env-cppflags=%s",
$mm->quote_literal($mm->{INC})) . "\\",
-
-
+
+
"\t\t".sprintf(" --env-libs=%s",
$mm->quote_literal($mm->{LDLOADLIBS}. ' ' .
$PLCBTopLevel::U_LibPath)) . "\\",
-
-
+
+
"\t\t".sprintf(" --rpath=%s",
$mm->quote_literal($mm->{LD_RUN_PATH})) . "\\",
"\t\t".join(" ", @$deps)
-
-
-
+
+
+
#end long commandline invocation
#"\t".'$(MKPATH) ' . $build,
#"\t".'$(TOUCH) $@',
);
-
+
return @lines;
}
@@ -164,21 +174,21 @@ sub create_buildscript_invocation {
sub mangle_parent_makefile {
my ($parent,$deps) = @_;
no strict 'refs';
-
+
log_warn("Mangling parent MM methods for extra dependencies");
-
+
my $libpath = File::Spec->catfile($Sharepath, 'lib');
-
+
my $methname = ref($parent).'::dynamic_lib';
my $old_meth = $parent->can('dynamic_lib');
-
+
my $blib_dep_path = "\$(INST_LIB)\$(DFSEP)$Sharepath";
my $dest_dep_path = "\$(DESTINSTALLSITELIB)\$(DFSEP)$Sharepath";
-
+
my $dep = "$blib_dep_path\$(DFSEP)lib\$(DFSEP)libcouchbase.\$(SO)";
-
+
$parent->{MYEXTLIB} = $dep;
-
+
*{ref($parent) . "::dynamic_lib"} = sub {
my ($mm,@args) = @_;
my $ret = $old_meth->($mm,@args, INST_DYNAMIC_DEP => $dep);
@@ -186,108 +196,110 @@ sub mangle_parent_makefile {
"\$(MYEXTLIB) ::",
"\t\$(NOOP)",
) . $ret;
-
+
return $ret;
};
-
+
my $ldload = $parent->{LDLOADLIBS} || "";
my $runpath = $parent->{LD_RUN_PATH} || "";
-
-
+
+
$runpath = "$blib_dep_path\$(DFSEP)lib:" .
"$dest_dep_path\$(DFSEP)lib".
":$runpath";
$ldload = "-L$blib_dep_path\$(DFSEP)lib";
-
+
{
my $parent_dir = abs_path("..");
$parent->{INST_LIB} = File::Spec->catfile($parent_dir,
$parent->{INST_LIB});
}
-
+
$parent->{LDLOADLIBS} = $ldload;
$parent->{LD_RUN_PATH} = $runpath;
-
+
$parent->{INC} .= " -I$blib_dep_path\$(DFSEP)include";
-
-
+
+
my $parent_inc = $parent->{INC};
-
+
my $inc_oneliner = sprintf("PLCB_ConfUtil::write_tmpflags(qq{%s})",
$parent_inc);
-
+
no warnings qw(redefine once);
*MY::postamble = sub {
my @lines = (
#get an absolute reference to $(INST_LIB)
-
+
#"INST_LIB := ".
#'$(shell '.
# $parent->oneliner('print abs_path("$(INST_LIB)")',
# [ '-MCwd=abs_path' ])
#.' )',
-
+
"$dep:",
(insert_announcement("will build for ultimate target $dep")),
(create_buildscript_invocation($parent,
$blib_dep_path, $dest_dep_path, $deps)),
(insert_announcement("dependencies done")),
-
+
#now try to insert some constants.
"\t".$parent->oneliner($inc_oneliner, ['-I../', '-MPLCB_ConfUtil']),
"",
"",
-
-
+
+
"all :: $dep",
);
-
+
return join("\n", @lines);
- };
+ };
}
sub MM_Configure {
my ($self,$h) = @_;
my $parent = $ExtUtils::MakeMaker::Parent[0];
$PLCBTopLevel::MM_TopLevel = $parent;
-
+
$PARENT_MM = $parent;
die("Must be run from within top-level Makefile.PL") unless $parent;
my @to_build;
-
+
if($ENV{PLCB_BUILD_ALL}) {
log_err('build_all reuqested');
@to_build = qw(VBUCKET COUCHBASE EVENT ISASL);
goto GT_MANGLE;
}
-
+
my $have_libcouchbase =
- check_dependency('couchbase',$LIBCOUCHBASE_CFUNC);
-
+ check_dependency('couchbase',$LIBCOUCHBASE_CFUNC,
+ header => ['sys/types.h', 'libcouchbase/couchbase.h'] );
+
if($have_libcouchbase) {
-
return $h; #nothing to do here.
} else {
push @to_build, qw(COUCHBASE VBUCKET);
}
-
+
if(!check_dependency(
- 'event', $LIBEVENT_CFUNC, header => 'event.h')) {
+ 'event', $LIBEVENT_CFUNC, header => ['event.h'] )) {
push @to_build, 'EVENT';
}
- if(!check_dependency(['sasl2', 'sasl', 'isasl'])) {
+ if(!check_dependency(
+ ['sasl2', 'sasl'], $LIBSASL_CFUNC,
+ header => [ 'stdlib.h', 'sasl/sasl.h'] )) {
push @to_build, 'ISASL';
}
-
+
GT_MANGLE:
log_err("We need to build the following dependencies:", @to_build);
mangle_parent_makefile($parent, \@to_build);
-
-
+
+
return $h;
}
$MM_Options{CONFIGURE} = \&MM_Configure;
-WriteMakefile(%MM_Options);
+WriteMakefile(%MM_Options);
Please sign in to comment.
Something went wrong with that request. Please try again.