From 836832cc1593e5df139e24e9cb0c81ca2f05ea86 Mon Sep 17 00:00:00 2001 From: Mark Nunberg Date: Mon, 2 Jul 2012 23:44:56 -0700 Subject: [PATCH] Make compatible with newer libcouchbase versions (with less deps) - 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) --- MANIFEST.in | 1 - Makefile.PL | 3 ++- PLCB_Config.pm | 5 ++--- build_libraries.pl | 8 -------- src/Makefile.PL | 21 +++++---------------- 5 files changed, 9 insertions(+), 29 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 6fec731..e344bdb 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 diff --git a/Makefile.PL b/Makefile.PL index 7f24243..4139fe5 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -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 < '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', }; diff --git a/build_libraries.pl b/build_libraries.pl index 294d3f3..e275e6f 100755 --- a/build_libraries.pl +++ b/build_libraries.pl @@ -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"; ################################################################################ ################################################################################ @@ -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}; diff --git a/src/Makefile.PL b/src/Makefile.PL index 910f0ec..b060a9b 100644 --- a/src/Makefile.PL +++ b/src/Makefile.PL @@ -72,14 +72,6 @@ return 1; EOC -my $LIBSASL_CFUNC = < -sasl_server_init(NULL, NULL); -return 0; - -EOC - sub check_dependency { my ($names,$fn,%extra) = @_; $names = ref $names ? $names : [ $names ]; @@ -87,6 +79,10 @@ sub check_dependency { 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); @@ -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; } @@ -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".