Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

Diff of /SOAP-Transport-TCP/trunk/Build [000000] .. [r389] Maximize Restore

  Switch to unified view

a b/SOAP-Transport-TCP/trunk/Build
1
#! /usr/bin/perl
2
3
use strict;
4
use Cwd;
5
use File::Basename;
6
use File::Spec;
7
8
sub magic_number_matches {
9
  return 0 unless -e '_build/magicnum';
10
  local *FH;
11
  open FH, '_build/magicnum' or return 0;
12
  my $filenum = <FH>;
13
  close FH;
14
  return $filenum == 245236;
15
}
16
17
my $progname;
18
my $orig_dir;
19
BEGIN {
20
  $^W = 1;  # Use warnings
21
  $progname = basename($0);
22
  $orig_dir = Cwd::cwd();
23
  my $base_dir = '/home/martin/workspace/SOAP-Transport-TCP';
24
  if (!magic_number_matches()) {
25
    unless (chdir($base_dir)) {
26
      die ("Couldn't chdir($base_dir), aborting\n");
27
    }
28
    unless (magic_number_matches()) {
29
      die ("Configuration seems to be out of date, please re-run 'perl Build.PL' again.\n");
30
    }
31
  }
32
  unshift @INC,
33
    (
34
35
    );
36
}
37
38
close(*DATA) unless eof(*DATA); # ensure no open handles to this script
39
40
use Module::Build;
41
42
# Some platforms have problems setting $^X in shebang contexts, fix it up here
43
$^X = Module::Build->find_perl_interpreter;
44
45
if (-e 'Build.PL' and not Module::Build->up_to_date('Build.PL', $progname)) {
46
   warn "Warning: Build.PL has been altered.  You may need to run 'perl Build.PL' again.\n";
47
}
48
49
# This should have just enough arguments to be able to bootstrap the rest.
50
my $build = Module::Build->resume (
51
  properties => {
52
    config_dir => '_build',
53
    orig_dir => $orig_dir,
54
  },
55
);
56
57
$build->dispatch;