jq: set -D_REENTRANT for builds on darwin (#34691)
This commit is contained in:
parent
b145085fff
commit
ca6e178890
@ -1,48 +0,0 @@
|
|||||||
diff --git a/src/builtin.c b/src/builtin.c
|
|
||||||
old mode 100644
|
|
||||||
new mode 100755
|
|
||||||
index c6c8c2e..e336472
|
|
||||||
--- a/src/builtin.c
|
|
||||||
+++ b/src/builtin.c
|
|
||||||
@@ -185,7 +185,7 @@ static jv f_modf(jq_state *jq, jv input) {
|
|
||||||
return jv_array_append(ret, jv_number(i));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
-#ifdef HAVE_LGAMMA_R
|
|
||||||
+#if defined(HAVE_LGAMMA_R) && !(defined(__APPLE__) && defined(__GNUC__) && !defined(_REENTRANT))
|
|
||||||
static jv f_lgamma_r(jq_state *jq, jv input) {
|
|
||||||
if (jv_get_kind(input) != JV_KIND_NUMBER) {
|
|
||||||
return type_error(input, "number required");
|
|
||||||
@@ -1581,7 +1581,7 @@ static const struct cfunction function_list[] = {
|
|
||||||
#ifdef HAVE_MODF
|
|
||||||
{(cfunction_ptr)f_modf,"modf", 1},
|
|
||||||
#endif
|
|
||||||
-#ifdef HAVE_LGAMMA_R
|
|
||||||
+#if defined(HAVE_LGAMMA_R) && !(defined(__APPLE__) && defined(__GNUC__) && !defined(_REENTRANT))
|
|
||||||
{(cfunction_ptr)f_lgamma_r,"lgamma_r", 1},
|
|
||||||
#endif
|
|
||||||
{(cfunction_ptr)f_plus, "_plus", 3},
|
|
||||||
diff --git a/src/builtin.c b/src/builtin.c
|
|
||||||
old mode 100644
|
|
||||||
new mode 100755
|
|
||||||
index c6c8c2e..e336472
|
|
||||||
--- a/src/builtin.c
|
|
||||||
+++ b/src/builtin.c
|
|
||||||
@@ -185,7 +185,7 @@ static jv f_modf(jq_state *jq, jv input) {
|
|
||||||
return jv_array_append(ret, jv_number(i));
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
-#ifdef HAVE_LGAMMA_R
|
|
||||||
+#if defined(HAVE_LGAMMA_R) && !(defined(__APPLE__) && defined(__GNUC__) && !defined(_REENTRANT))
|
|
||||||
static jv f_lgamma_r(jq_state *jq, jv input) {
|
|
||||||
if (jv_get_kind(input) != JV_KIND_NUMBER) {
|
|
||||||
return type_error(input, "number required");
|
|
||||||
@@ -1581,7 +1581,7 @@ static const struct cfunction function_list[] = {
|
|
||||||
#ifdef HAVE_MODF
|
|
||||||
{(cfunction_ptr)f_modf,"modf", 1},
|
|
||||||
#endif
|
|
||||||
-#ifdef HAVE_LGAMMA_R
|
|
||||||
+#if defined(HAVE_LGAMMA_R) && !(defined(__APPLE__) && defined(__GNUC__) && !defined(_REENTRANT))
|
|
||||||
{(cfunction_ptr)f_lgamma_r,"lgamma_r", 1},
|
|
||||||
#endif
|
|
||||||
{(cfunction_ptr)f_plus, "_plus", 3},
|
|
@ -6,7 +6,6 @@
|
|||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from spack.operating_systems.mac_os import macos_version
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
|
|
||||||
@ -22,8 +21,13 @@ class Jq(AutotoolsPackage):
|
|||||||
depends_on("oniguruma")
|
depends_on("oniguruma")
|
||||||
depends_on("bison@3.0:", type="build")
|
depends_on("bison@3.0:", type="build")
|
||||||
|
|
||||||
if sys.platform == "darwin" and macos_version() >= Version("10.15"):
|
def configure_args(self):
|
||||||
patch("builtinc.patch", when="@1.5:")
|
# on darwin, required math functions like lgammaf_r are gated behind
|
||||||
|
# explicit reentrant flag
|
||||||
|
if sys.platform == "darwin":
|
||||||
|
return ["CPPFLAGS=-D_REENTRANT"]
|
||||||
|
else:
|
||||||
|
return []
|
||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
@on_package_attributes(run_tests=True)
|
@on_package_attributes(run_tests=True)
|
||||||
|
Loading…
Reference in New Issue
Block a user