comparison revisions.pl.in @ 1113:123812e02bc8

Split out LLVM_REV into separate header, to reduce rebuilding when only the LDC revision has changed.
author Frits van Bommel <fvbommel wxs.nl>
date Fri, 13 Mar 2009 16:18:43 +0100
parents 829ac3f30103
children 165a920f4e88
comparison
equal deleted inserted replaced
1112:829ac3f30103 1113:123812e02bc8
44 #define LDC_VERSIONS_H 44 #define LDC_VERSIONS_H
45 $extra_includes 45 $extra_includes
46 46
47 // LLVM version string, for use in -version output 47 // LLVM version string, for use in -version output
48 #define LLVM_REV_STR $llvm_rev_str$llvm_date 48 #define LLVM_REV_STR $llvm_rev_str$llvm_date
49 // LLVM svn revision number, used to adapt to changes in LLVM
50 // (Is 0 if LLVM is not an SVN trunk version)
51 #define LLVM_REV $llvm_rev_nr
52 // LDC version string, for use in -version output 49 // LDC version string, for use in -version output
53 #define LDC_REV "rev. $ldc_rev" 50 #define LDC_REV "rev. $ldc_rev"
54 51
55 #endif // LDC_VERSIONS_H\n!; 52 #endif // LDC_VERSIONS_H\n!;
56 53
61 if ($old ne $out) { 58 if ($old ne $out) {
62 open $revh, ">revisions.h" or die "cannot create revisions.h: $!"; 59 open $revh, ">revisions.h" or die "cannot create revisions.h: $!";
63 print $revh $out; 60 print $revh $out;
64 close $revh; 61 close $revh;
65 } 62 }
63
64 $out = qq!#ifndef LDC_LLVM_VERSION_H
65 #define LDC_LLVM_VERSION_H
66
67 // LLVM svn revision number, used to adapt to changes in LLVM
68 // (Is 0 if LLVM is not an SVN trunk version)
69 #define LLVM_REV $llvm_rev_nr
70
71 #endif // LDC_LLVM_VERSION_H\n!;
72
73 $old = "";
74 open $revh, "llvm-version.h" and $old = join "", <$revh>;
75
76 if ($old ne $out) {
77 open $revh, ">llvm-version.h" or die "cannot create llvm-version.h: $!";
78 print $revh $out;
79 close $revh;
80 }