summaryrefslogtreecommitdiff
path: root/bin/nightlybuilds/print_config.pl
blob: 68a685b94b4f9038eb71f4a174a9cd8aa4428bcb (plain)
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
eval '(exit $?0)' && eval 'exec perl -S $0 ${1+"$@"}'
    & eval 'exec perl -S $0 $argv:q'
    if 0;

#
# @file print_config.pl
#
# $Id$
#
# @author Darrell Brunsch <brunsch@doc.ece.uci.edu>
#
# Print out the build configuration, i.e. the contents of the config.h
# file, the latest ChangeLog entries and (if present) the
# platform_macros.GNU file.
#

use strict;
use FileHandle;

##############################################################################

sub print_file ($$)
{
    my $filename = shift;
    my $printall = shift;

    my $filehandle = new FileHandle ($filename, "r");

    while (<$filehandle>) {
        print $_;

        last if ($printall == 0);
    }
}

##############################################################################

if ($#ARGV < 0) {
    print STDERR "Not enough arguments, pass in ACEROOT\n";
    exit 1;
}

my $root = shift @ARGV;

# convert to forward slash
$root =~ s/\\/\//g;

# chop off trailing slash
if ($root =~ m/^(.*)\/$/) {
    $root = $1;
}

# last ACE Changelog Entry

if (-r "$root/ChangeLog") {
    print "================ ACE ChangeLog ================\n";
    print_file ("$root/ChangeLog", 0);
}

# last TAO Changelog Entry
if (-r "$root/TAO/ChangeLog") {
    print "================ TAO ChangeLog ================\n";
    print_file ("$root/TAO/ChangeLog", 0);
}

# config.h, if it exists
if (-r "$root/ace/config.h") {
    print "================ config.h ================\n";
    print_file ("$root/ace/config.h", 1);
}

# platform_macros.GNU, if it exists
if (-r "$root/include/makeinclude/platform_macros.GNU") {
    print "================ platform_macros.GNU ================\n";
    print_file ("$root/include/makeinclude/platform_macros.GNU", 1);
}