]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - configure
More tidyups
[user/henk/code/inspircd.git] / configure
index dc6e655ef8c94fa95bc366d8c3ef225525f41acd..456a33525446e1c1b73a307e1b7e4bccc47e6267 100755 (executable)
--- a/configure
+++ b/configure
@@ -1072,7 +1072,6 @@ sub getosflags {
        if ($config{OSNAME} =~ /BSD$/) {
                $config{LDLIBS} = "-lstdc++";
                $config{FLAGS}  = "-fno-strict-aliasing -fPIC -Wall -Woverloaded-virtual $config{OPTIMISATI}";
-               $config{FLAGS}  .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
                $config{MAKEPROG} = "gmake";
                if ($config{OSNAME} eq "OpenBSD") {
                        chomp($foo = `eg++ -dumpversion | cut -c 1`);
@@ -1106,6 +1105,7 @@ sub getosflags {
                        $config{STATIC_LINK} = "yes";
                        return "Cygwin-Static";
                }
+               $config{FLAGS}  .= " " . $ENV{CXXFLAGS} if exists($ENV{CXXFLAGS});
                return "Linux";
        }
        
@@ -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");