-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbootstrap.pl
More file actions
executable file
·84 lines (58 loc) · 1.82 KB
/
bootstrap.pl
File metadata and controls
executable file
·84 lines (58 loc) · 1.82 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#!/usr/bin/perl
# bootstrap.pl wkretzsch@gmail.com
# 19 Feb 2015
use warnings;
use strict;
use File::Path qw(make_path);
use File::Basename;
use File::Slurp;
use autodie;
use FindBin qw/$Bin/;
# run autoconf, etc.
print STDERR "autoreconf --install --symlink...\n";
system('autoreconf --install --symlink');
# compile gtest
my $gtestDir = "gtest-1.7.0";
my $cmd = "cd $gtestDir/make && make";
print STDERR $cmd ."\n";
system($cmd);
# find package version
my @configFile = read_file("$Bin/configure.ac");
my @lines = grep { m/^\s*AC_INIT/ } @configFile;
die "Error in configure.ac file: too many AC_INIT lines" if @lines > 1;
die "could not find AC_INIT" if @lines < 1;
my $line = shift @lines;
chomp $line;
$line =~ s/ //g;
my @line = split( /[\(\),\[\]]+/, $line );
my ( undef, $binName, $version, $email ) = @line;
my $buildDir = "$Bin/$binName.$version";
print STDERR "Creating Build dir at " . basename($buildDir) . "\n";
make_path($buildDir);
chdir "$buildDir";
print STDERR "Configuring...\n";
system "../configure";
print STDERR "make all";
system "make all";
print STDERR "Returning to base dir\n";
chdir "$Bin";
print STDERR "\nAll files built in $buildDir\n";
__END__
=head1 NAME
bootstrap.pl
=head1 SYNOPSIS
=head1 DESCRIPTION
Stub documentation for bootstrap.pl,
created by template.el.
It looks like the author of this script was negligent
enough to leave the stub unedited.
=head1 AUTHOR
Warren Winfried Kretzschmar, E<lt>wkretzsch@gmail.comE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2015 by Warren Winfried Kretzschmar
This program is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.2 or,
at your option, any later version of Perl 5 you may have available.
=head1 BUGS
None reported... yet.
=cut