From 074a6f224f17812b06a9e269d756aeb53c5d8a85 Mon Sep 17 00:00:00 2001 From: Olivier Cessenat Date: Mon, 22 Feb 2021 10:50:25 +0100 Subject: [PATCH] harfbuzz: allows compilation standard being set properly for gcc (#21810) --- var/spack/repos/builtin/packages/harfbuzz/package.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/var/spack/repos/builtin/packages/harfbuzz/package.py b/var/spack/repos/builtin/packages/harfbuzz/package.py index 149e7e1e5f..31a5068cfc 100644 --- a/var/spack/repos/builtin/packages/harfbuzz/package.py +++ b/var/spack/repos/builtin/packages/harfbuzz/package.py @@ -40,12 +40,21 @@ def url_for_version(self, version): return url.format(version) + # Function borrowed from superlu + def flag_handler(self, name, flags): + flags = list(flags) + if name == 'cxxflags': + flags.append(self.compiler.cxx11_flag) + if name == 'cflags': + if '%pgi' not in self.spec and self.spec.satisfies('%gcc@:5.1'): + flags.append('-std=gnu99') + return (None, None, flags) + def configure_args(self): args = [] # disable building of gtk-doc files following #9771 args.append('--disable-gtk-doc-html') true = which('true') - args.append('CXXFLAGS={0}'.format(self.compiler.cxx11_flag)) args.append('GTKDOC_CHECK={0}'.format(true)) args.append('GTKDOC_CHECK_PATH={0}'.format(true)) args.append('GTKDOC_MKPDF={0}'.format(true))