summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-04 17:03:10 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2006-12-04 17:03:10 +0000
commit6115897d2689a19fcf6f68ebd71d65fa56b4dbb5 (patch)
tree84f2ed6ebb7fd326502437033e5ac3cf1888f37e /configure
parent3e52f21044fcc8f2513cbd6a2cad6f481188ae49 (diff)
Fix for bug #177, generate the version string at configure time and write it into the .inspircd.inc,
then when running the ./inspircd, output the string, this way we dont need the source code to hand to report the version. (btw special, the doctor has cured you of perlprogramophobia) git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@5841 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure b/configure
index 28c1e9039..456a33525 100755
--- a/configure
+++ b/configure
@@ -1311,6 +1311,18 @@ EOF
opendir(DIRHANDLE, $this);
+ # Do this once here, and cache it in the .*.inc files,
+ # rather than attempting to read src/version.sh from
+ # compiled code -- we might not have the source to hand.
+ # Fix for bug#177 by Brain.
+
+ chomp(my $version = `sh ./src/version.sh`);
+ chomp(my $revision = getrevision());
+ $version = "$version(r$revision)";
+
+ # We can actually parse any file starting with . and ending with .inc,
+ # but right now we only parse .inspircd.inc to form './inspircd'
+
foreach $name (sort readdir(DIRHANDLE)) {
if ($name =~ /^\.(.+)\.inc$/) {
$file = $1;
@@ -1335,6 +1347,7 @@ EOF
$tmp =~ s/\@EXECUTABLE\@/$exe/;
$tmp =~ s/\@MAKEORDER\@/$config{MAKEORDER}/;
$tmp =~ s/\@STATICLIBS\@/$config{STATICLIBS}/;
+ $tmp =~ s/\@VERSION\@/$version/;
print "Writing \033[1;32m$file\033[0m\n";
open(FILEHANDLE, ">$file");