]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - make/configure.pm
Merge pull request #1252 from SaberUK/master+distribution
[user/henk/code/inspircd.git] / make / configure.pm
index db9c42eb95deb9d7386daf38ca7b6171e053f26e..6b4693d453532d216f578a771e6c2fb193a72a19 100644 (file)
@@ -38,7 +38,6 @@ use File::Spec::Functions qw(catfile);
 
 use make::common;
 use make::console;
-use make::utilities;
 
 use constant CONFIGURE_DIRECTORY     => '.configure';
 use constant CONFIGURE_CACHE_FILE    => catfile(CONFIGURE_DIRECTORY, 'cache.cfg');
@@ -56,7 +55,6 @@ our @EXPORT = qw(CONFIGURE_CACHE_FILE
                  write_configure_cache
                  get_compiler_info
                  find_compiler
-                 get_property
                  parse_templates);
 
 sub __get_socketengines {
@@ -161,7 +159,8 @@ MISC OPTIONS
   --socketengine=[name]         Sets the socket engine to be used. Possible
                                 values are $SELIST.
   --uid=[id|name]               Sets the user to run InspIRCd as.
-  --update                      Updates the build environment.
+  --update                      Updates the build environment with the settings
+                                from the cache.
 
 
 FLAGS
@@ -182,7 +181,7 @@ sub cmd_update {
        say 'Updating...';
        my %config = read_configure_cache();
        my %compiler = get_compiler_info($config{CXX});
-       my %version = get_version();
+       my %version = get_version $config{DISTRIBUTION};
        parse_templates(\%config, \%compiler, \%version);
        say 'Update complete!';
        exit 0;
@@ -220,7 +219,7 @@ sub read_configure_cache {
        open(CACHE, CONFIGURE_CACHE_FILE) or return %config;
        while (my $line = <CACHE>) {
                next if $line =~ /^\s*($|\#)/;
-               my ($key, $value) = ($line =~ /^(\S+)="(.*)"$/);
+               my ($key, $value) = ($line =~ /^(\S+)(?:\s(.*))?$/);
                $config{$key} = $value;
        }
        close(CACHE);
@@ -238,7 +237,7 @@ sub write_configure_cache(%) {
        open(CACHE, '>', CONFIGURE_CACHE_FILE) or print_error "unable to write ${\CONFIGURE_CACHE_FILE}: $!";
        while (my ($key, $value) = each %config) {
                $value //= '';
-               say CACHE "$key=\"$value\"";
+               say CACHE "$key $value";
        }
        close(CACHE);
 }
@@ -268,21 +267,6 @@ sub find_compiler {
        }
 }
 
-sub get_property($$;$)
-{
-       my ($file, $property, $default) = @_;
-       open(MODULE, $file) or return $default;
-       while (<MODULE>) {
-               if ($_ =~ /^\/\* \$(\S+): (.+) \*\/$/) {
-                       next unless $1 eq $property;
-                       close(MODULE);
-                       return translate_functions($2, $file);
-               }
-       }
-       close(MODULE);
-       return $default // '';
-}
-
 sub parse_templates($$$) {
 
        # These are actually hash references