summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 04:15:40 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-05-20 04:15:40 +0000
commit814b83918e1628d0293b72a20d7147d07a17d1f1 (patch)
treedde44095ab16e8df357c595427ce95133f19d130 /configure.in
parent50732b7b6e4c4d895b7e015d06b4d7b2e61876a3 (diff)
configure.in: attribute arguments
* configure.in (RUBY_FUNC_ATTRIBUTE): allow attribute arguments in the macro. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50555 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in15
1 files changed, 9 insertions, 6 deletions
diff --git a/configure.in b/configure.in
index f75d97e0ca..64201e4a86 100644
--- a/configure.in
+++ b/configure.in
@@ -1611,7 +1611,7 @@ EOH
dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition)
AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl
m4_ifval([$2], dnl
- [AS_VAR_PUSHDEF([attrib],[$2])], dnl
+ [AS_VAR_PUSHDEF([attrib], m4_bpatsubst([$2], [(.*)], []))], dnl
[AS_VAR_PUSHDEF([attrib],[FUNC_]AS_TR_CPP($1))] dnl
)dnl
m4_ifval([$3], dnl
@@ -1619,8 +1619,9 @@ m4_ifval([$3], dnl
[AS_VAR_PUSHDEF([rbcv],[rb_cv_func_][$1])]dnl
)dnl
m4_pushdef([attrib_code],[m4_bpatsubst([$1],["],[\\"])])dnl
+m4_pushdef([attrib_params],[m4_bpatsubst([$2(x)],[^[^()]*(\([^()]*\)).*],[\1])])dnl
m4_ifval([$4], [rbcv_cond=["$4"]; test "$rbcv_cond" || unset rbcv_cond])
-AC_CACHE_CHECK(for m4_ifval([$2],[$2],[$1]) function attribute, rbcv,
+AC_CACHE_CHECK(for m4_ifval([$2],[m4_bpatsubst([$2], [(.*)], [])],[$1]) function attribute, rbcv, dnl
[rbcv=x
RUBY_WERROR_FLAG([
for mac in \
@@ -1631,18 +1632,20 @@ for mac in \
m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"})
AC_TRY_COMPILE(
m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond})
-[@%:@define ]attrib[(x) $mac]
+[@%:@define ]attrib[](attrib_params)[ $mac]
m4_ifval([$4],${rbcv_cond+[@%:@else]}
-${rbcv_cond+[@%:@define ]attrib[(x) x]}
+${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]}
${rbcv_cond+[@%:@endif]})
- attrib[(void conftest_attribute_check(void));], [],
+[@%:@define x void conftest_attribute_check(void)]
+ attrib[](attrib_params)[;], [],
[rbcv="$mac"; break])
done
])])
if test "$rbcv" != x; then
- RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[(x)], $rbcv)
+ RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv)
fi
m4_ifval([$4], [unset rbcv_cond]) dnl
+m4_popdef([attrib_params])dnl
m4_popdef([attrib_code])dnl
AS_VAR_POPDEF([attrib])dnl
AS_VAR_POPDEF([rbcv])dnl