summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Dorier <mdorier@anl.gov>2023-07-24 17:45:21 -0500
committerGitHub <noreply@github.com>2023-07-24 15:45:21 -0700
commitb2ed10dd837677cb98d15a0a483b489b24922c59 (patch)
treed6400b6fb94b6000c42a5ab91bc81e4abb56f6e9
parent1c3dc0bd5f45d3b5e80163eabd6db102ea16cf32 (diff)
downloadspack-b2ed10dd837677cb98d15a0a483b489b24922c59.tar.gz
spack-b2ed10dd837677cb98d15a0a483b489b24922c59.tar.bz2
spack-b2ed10dd837677cb98d15a0a483b489b24922c59.tar.xz
spack-b2ed10dd837677cb98d15a0a483b489b24922c59.zip
quickjs: make Makefile use correct compiler (#39060)
* quickjs: make Makefile use correct compiler * added lto variant and better handling of compilers * quickjs: correct style * quickjs: correct style for flake8
-rw-r--r--var/spack/repos/builtin/packages/quickjs/package.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/var/spack/repos/builtin/packages/quickjs/package.py b/var/spack/repos/builtin/packages/quickjs/package.py
index b690950952..6f77137b75 100644
--- a/var/spack/repos/builtin/packages/quickjs/package.py
+++ b/var/spack/repos/builtin/packages/quickjs/package.py
@@ -25,7 +25,16 @@ class Quickjs(MakefilePackage):
"2020-09-06", sha256="0021a3e8cdc6b61e225411d05e2841d2437e1ccf4b4cabb9a5f7685ebfb57717"
)
+ variant("lto", default=True, when="%gcc", description="Enable link-time optimization")
+
def edit(self, spec, prefix):
makefile = FileFilter("Makefile")
makefile.filter("prefix=/usr/local", "prefix={}".format(prefix))
makefile.filter("lib/quickjs", "lib")
+ makefile.filter("CFLAGS=", "CFLAGS+=-fPIC ")
+ if "+lto" not in spec:
+ makefile.filter("CONFIG_LTO=y", "")
+ cc = self.compiler.cc
+ makefile.filter("^ *CC=.*", " CC={}".format(cc))
+ makefile.filter("^ *HOST_CC=.*", " HOST_CC={}".format(cc))
+ makefile.filter("gcc-ar", "{}-ar".format(cc))