X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=make%2Fdirective.pm;h=c0c2aee85039bb297ba9f016d8fb233ab032276f;hb=bd6e75ffa1a9827aa135e313eca4e5b396ebda2f;hp=b178228fd67014db3f274ca73ad51ac5ed8709aa;hpb=b2ac8cc0a6405946a388b80df3be21bc276a61f3;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/make/directive.pm b/make/directive.pm index b178228fd..c0c2aee85 100644 --- a/make/directive.pm +++ b/make/directive.pm @@ -164,7 +164,7 @@ sub __function_execute { return $defaults; } - # Executing the command failed and we don't have any defaults so give up. + # Executing the command failed and we don't have any defaults so give up. __error $file, "`<|GREEN $command|>` exited with a non-zero exit code!"; } @@ -222,6 +222,22 @@ sub __function_find_linker_flags { __error $file, "unable to find the <|GREEN $name|> linker flags for <|GREEN ${\basename $file, '.cpp'}|>!"; } +sub __function_require_compiler { + my ($file, $name, $minimum, $maximum) = @_; + + # Look up information about the compiler. + return undef unless $ENV{CXX}; + my %compiler = get_compiler_info($ENV{CXX}); + + # Check whether the current compiler is suitable. + return undef unless $compiler{NAME} eq $name; + return undef if defined $minimum && $compiler{VERSION} < $minimum; + return undef if defined $maximum && $compiler{VERSION} > $maximum; + + # Requirement directives don't change anything directly. + return ""; +} + sub __function_require_system { my ($file, $name, $minimum, $maximum) = @_; my ($system, $version);