| 1 | #! /usr/bin/perl -w |
| 2 | use strict; |
| 3 | sub output { |
| 4 | print @_ or die "$0: stdout: $!\n"; |
| 5 | } |
| 6 | my @csv = `../config.status --version`; |
| 7 | my $version; |
| 8 | my $options; |
| 9 | my $cc; |
| 10 | my $compiler; |
| 11 | for(@csv) { |
| 12 | chomp; |
| 13 | if(/disorder config\.status (\S+)/) { |
| 14 | $version = $1; |
| 15 | } |
| 16 | if(/with options \"(.*)\"/) { |
| 17 | $options = $1; |
| 18 | } |
| 19 | } |
| 20 | if(exists $ENV{CC}) { |
| 21 | $cc = $ENV{CC}; |
| 22 | $cc =~ s/\s+/ /g; |
| 23 | my @cv = `$cc --version`; |
| 24 | $compiler = $cv[0]; |
| 25 | } |
| 26 | die "no version found\n" unless defined $version; |
| 27 | output("%s (DisOrder) $version\n"); |
| 28 | output("Copyright (C) 2003-2008 Richard Kettlewell et al\n"); |
| 29 | output("License GPLv3+: GNU GPL version 3 or later:\n"); |
| 30 | output(" http://www.gnu.org/licenses/gpl-3.0.html\n"); |
| 31 | output("This is free software: you are free to change and redistribute it.\n"); |
| 32 | output("There is NO WARRANTY, to the extent permitted by law.\n"); |
| 33 | output("WARNING: -Werror not used in this build\n") if $cc !~ /-Werror/; |
| 34 | |
| 35 | close STDOUT or die "$0: stdout: $!\n"; |