readline: fix for nvhpc (#37024)

This commit is contained in:
Harmen Stoppels 2023-04-21 11:02:55 +02:00 committed by GitHub
parent cac44b9e15
commit 7cf53a647e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -64,8 +64,11 @@ class Readline(AutotoolsPackage, GNUMirrorPackage):
def build(self, spec, prefix): def build(self, spec, prefix):
make("SHLIB_LIBS=" + spec["ncurses:wide"].libs.ld_flags) make("SHLIB_LIBS=" + spec["ncurses:wide"].libs.ld_flags)
def patch(self): def flag_handler(self, name, flags):
# Remove flags not recognized by the NVIDIA compiler # nvhpc is detected as a gnu compiler, which causes the build system
if self.spec.satisfies("%nvhpc"): # to add unrecognized -W flags. Defining CFLAGS overrides those defaults.
filter_file("${GCC+-Wno-parentheses}", "", "configure", string=True) if name == "cflags" and self.spec.satisfies("%nvhpc"):
filter_file("${GCC+-Wno-format-security}", "", "configure", string=True) flags.append("-O2")
flags.append("-g")
return (None, flags, None)
return (flags, None, None)