Permalink
Browse files

Fixed build scripts, changed absolute to relative time offsets

Builds should now work on most other systems which were failing before
  • Loading branch information...
1 parent 22fe27c commit 9c6277d601479fd1f33c987f353cedd4f7423c1b @mnunberg committed Feb 19, 2012
Showing with 1,131 additions and 244 deletions.
  1. +9 −2 MANIFEST
  2. +1 −0 MANIFEST.SKIP
  3. +7 −0 MANIFEST.in
  4. +49 −81 Makefile.PL
  5. +6 −4 PLCB_ConfUtil.pm
  6. +5 −2 PLCB_Config.pm
  7. +61 −105 README.pod
  8. +3 −0 author_utils/gen_manifest.pl
  9. +173 −37 build_libraries.pl
  10. +483 −0 inc/Devel/CheckLib.pm
  11. +1 −3 lib/Couchbase/Client.pm
  12. +1 −1 lib/Couchbase/Client/Async.pm
  13. +293 −0 src/Makefile.PL
  14. +5 −4 xs/Client.xs
  15. +2 −2 xs/Client_multi.xs
  16. +4 −1 xs/async_base.c
  17. +0 −2 xs/perl-couchbase.h
  18. +28 −0 xs/plcb-util.h
View
@@ -8,6 +8,8 @@ PLCB_ConfUtil.pm
PLCB_Config.pm
build_libraries.pl
+inc/Devel/CheckLib.pm
+
lib/Couchbase/Client.pm
lib/Couchbase/Client/Return.pm
lib/Couchbase/Client/Errors.pm
@@ -55,6 +57,11 @@ t/00-load.t
t/01-main.t
t/tmp/CouchbaseMock.jar
+src/Makefile.PL
+src/libcouchbase.pm
+
src/memcached-headers.tar.gz
-src/libcouchbase-1.0.0_50_g1a42d9e.tar.gz
-src/libvbucket-1.8.0.1_5_ga4397f3.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
View
@@ -5,3 +5,4 @@
^inst_dir/
.+_const\.pm
^author_utils
+^INSTALL_DIR
View
@@ -8,6 +8,8 @@ PLCB_ConfUtil.pm
PLCB_Config.pm
build_libraries.pl
+inc/Devel/CheckLib.pm
+
lib/Couchbase/Client.pm
lib/Couchbase/Client/Return.pm
lib/Couchbase/Client/Errors.pm
@@ -55,6 +57,11 @@ t/00-load.t
t/01-main.t
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
+src/libisasl-__LIBISASL_RELEASE__.tar.gz
View
@@ -1,7 +1,7 @@
#!/usr/bin/perl
+package PLCBTopLevel;
use strict;
use warnings;
-
use ExtUtils::MakeMaker;
use Dir::Self;
use Getopt::Long;
@@ -10,14 +10,50 @@ use File::Spec;
use Config;
use lib __DIR__;
use PLCB_ConfUtil;
+use lib 'inc';
+use Devel::CheckLib;
+use Data::Dumper;
+
+log_err(__DIR__ . "/Makefile.PL");
+$ENV{LD_RUN_PATH} ||= "";
+
+#$Verbose = 99;
GetOptions(
'dynamic' => \my $UseDynamic,
- 'include=s' => \my $ExtraInclude,
- 'ldpath=s' => \my $ExtraLDPath,
+ 'bundled' => \my $UseBundled,
+ 'incpath=s' => \our $U_IncPath,
+ 'libpath=s' => \our $U_LibPath
+) or die <<EOD;
+OPTIONS:
+--incpath=CPPFLAGS
+--libpath=LDFLAGS
+EOD
+
+#my $mm = ExtUtils::MakeMaker->new();
+
+our (@LIBS,$INC);
+our $MM_TopLevel;
+our $Constants_INC;
+
+push @LIBS, $U_LibPath if $U_LibPath;
+$INC = $U_IncPath || "";
+$Constants_INC = $INC;
+
+
+push @LIBS, '-lcouchbase';
+
+my %MM_Options = (
+ INC => $INC,
+ LIBS => [ join(' ', @LIBS) || '' ],
);
-my %MM_Options;
+$MM_Options{CONFIGURE} = sub {
+ my ($cls,$h) = @_;
+ $MM_TopLevel = $h;
+ return $h;
+};
+
################################################################################
### Our C Source Files ###
################################################################################
@@ -52,71 +88,16 @@ foreach ([qw(error Errors)], [qw(idx IDXConst)]) {
}
################################################################################
-### Check dependencies ###
-################################################################################
-my $inc;
-my $libs;
-
-################################################################################
### Check build type and options ###
################################################################################
-my $myextlib;
-
-my $inst_dir = PLCB_ConfUtil::get_inst_dir();
-my $inst_lib_dir = File::Spec->catfile($inst_dir, 'lib');
-my $inst_inc_dir = File::Spec->catfile($inst_dir, 'include');
-
-my $buildscript_options = "";
-
-#my @extra_deps;
-#foreach my $dep (['sasl2', 'sasl'], ['event', 'event']) {
-# my ($installed,$new) = @$dep;
-# print STDERR "Checking if $installed is present...";
-# if(check_lib(lib => $installed,
-# LIBS => $ExtraLDPath, INC => $ExtraInclude)) {
-# print STDERR "OK\n";
-# push @extra_deps, "-l$installed";
-# } else {
-# print STDERR "NOT FOUND (will build embedded)\n";
-# push @extra_deps, File::Spec->catfile($inst_lib_dir,
-# "lib".$new.$Config{lib_ext});
-# $buildscript_options .= ' --build-'.$new;
-# }
-#}
-
-if(!$UseDynamic) {
- $inc = '-I' . $inst_inc_dir;
- $libs = "-L$inst_lib_dir -lsasl2 -levent -ldl -lresolv";
-
- #Set path for linker and friends
- $myextlib = join(' ',
- map(File::Spec->catfile($inst_lib_dir, $_.'$(LIB_EXT)'),
- qw(libcouchbase libvbucket)));
-} else {
- $myextlib = "";
- $libs = " -lcouchbase -lvbucket -lcouchbase_libevent";
-}
-{
- $inc .= " " . join(" ", map("-I$_", split(/\s+/, $Config{locincpth})));
- $libs .= " " . join(" ", map("-L$_", split(/\s+/, $Config{libpth})));
+if($ENV{PLCB_BUILD_AUTHOR}) {
+ $MM_Options{OPTIMIZE} = '-Wdeclaration-after-statement -Werror -std=gnu89';
}
-foreach ([\$inc, \$ExtraInclude], [\$libs, \$ExtraLDPath]) {
- my ($defl,$extra) = @$_;
- if($$extra) {
- $$defl ||= "";
- $$defl = "$$extra $$defl";
- }
-}
-
-$MM_Options{INC} = $inc;
-$MM_Options{LIBS} = $libs;
-$MM_Options{MYEXTLIB} = $myextlib;
-
-#Write our temporary parameters
-PLCB_ConfUtil::write_tmpflags($inc, $libs);
+use Log::Fu;
+$MM_Options{NEEDS_LINKING} = 1;
WriteMakefile(
@@ -152,21 +133,21 @@ WriteMakefile(
'POE::Sugar::Attributes' => 0.02,
'POE' => 1.312,
},
-
- NEEDS_LINKING => 1,
- OPTIMIZE =>
- ' -Wdeclaration-after-statement -Werror -std=gnu89',
-
+
dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz', },
clean => { FILES => 'Couchbase-Client-* COMPILER_FLAGS' },
%MM_Options,
);
+#Write a list of compiler flags for our constants scripts.
+PLCB_ConfUtil::write_tmpflags($Constants_INC);
+
package MY;
use Config;
use strict;
use warnings;
+use Data::Dumper;
#thanks rafl!
sub const_cccmd {
@@ -188,17 +169,4 @@ sub libscan {
} else {
return $path;
}
-}
-
-sub postamble {
- return unless $myextlib;
-
- my $make_text = <<'EOM';
-$(MYEXTLIB):
- $(PERLRUN) build_libraries.pl __BUILD_LIBRARIES_OPTIONS__
-EOM
-
- $make_text =~ s/__BUILD_LIBRARIES_OPTIONS__/$buildscript_options/g;
- $make_text =~ s/^\s+/\t/msg;
- $make_text;
}
View
@@ -41,10 +41,12 @@ sub get_include_dir {
sub clean_cbc_sources {
my $dir_base = $config->{SRC_DIR};
-
- foreach my $lib (qw(couchbase vbucket)) {
- my $dir = sprintf("lib%s-%s", $lib,
- $config->{ "LIB" . uc($lib) . "_RELEASE" });
+ while (my ($kname,$release) = each %$config) {
+ next unless $kname =~ /RELEASE/;
+ my ($libname,$version) = ($kname =~ /(LIB[^_]+)(.+)/);
+ $libname = lc($libname);
+ my $dir = "$libname-$release";
+ warn $dir;
$dir = File::Spec->catfile($dir_base, $dir);
rmtree($dir);
}
View
@@ -15,8 +15,11 @@ my $params = {
'perl-Couchbase-Client/CouchbaseMock-0.5-SNAPSHOT.jar',
#version numbers for libcouchbase and libvbucket
- LIBVBUCKET_RELEASE => '1.8.0.1_5_ga4397f3',
- LIBCOUCHBASE_RELEASE => '1.0.0_50_g1a42d9e'
+ LIBVBUCKET_RELEASE => '1.8.0.2',
+ LIBCOUCHBASE_RELEASE => '1.0.1',
+
+ LIBISASL_RELEASE => '1.0.0_2_gc3f3496',
+ LIBEVENT_RELEASE => '2.0.17-stable',
};
Oops, something went wrong.

0 comments on commit 9c6277d

Please sign in to comment.