diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 07:05:25 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-01-20 07:05:25 +0000 |
commit | 0664a6377a7fc51e6d96d7b69361cc457e248b00 (patch) | |
tree | 73693b397f6eeae289b23379ce433dc6d3691419 /tool/m4/ruby_decl_attribute.m4 | |
parent | 645e441c32ea5379aef712a9d9a26a6db2c1740b (diff) | |
download | ruby-0664a6377a7fc51e6d96d7b69361cc457e248b00.tar.gz |
refactor split configure.ac into files
This does not (yet) change anything. The generated configure file
is the identical to previous one (except several empty lines added
and deleted).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61981 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool/m4/ruby_decl_attribute.m4')
-rw-r--r-- | tool/m4/ruby_decl_attribute.m4 | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/tool/m4/ruby_decl_attribute.m4 b/tool/m4/ruby_decl_attribute.m4 new file mode 100644 index 0000000000..f590e49160 --- /dev/null +++ b/tool/m4/ruby_decl_attribute.m4 @@ -0,0 +1,43 @@ +dnl RUBY_DECL_ATTRIBUTE(attrib, macroname, cachevar, condition, type, code) +AC_DEFUN([RUBY_DECL_ATTRIBUTE], [dnl +m4_ifval([$2], dnl + [AS_VAR_PUSHDEF([attrib], m4_bpatsubst([$2], [(.*)], []))], dnl + [AS_VAR_PUSHDEF([attrib], m4_toupper(m4_format(%.4s, [$5]))[_]AS_TR_CPP($1))] dnl +)dnl +m4_ifval([$3], dnl + [AS_VAR_PUSHDEF([rbcv],[$3])], dnl + [AS_VAR_PUSHDEF([rbcv],[rb_cv_]m4_format(%.4s, [$5])[_][$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],[m4_bpatsubst([$2], [(.*)], [])],[$1]) [$5] attribute, rbcv, dnl +[rbcv=x +RUBY_WERROR_FLAG([ +for mac in \ + "__attribute__ ((attrib_code)) x" \ + "x __attribute__ ((attrib_code))" \ + "__declspec(attrib_code) x" \ + x; do + m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"}) + AC_TRY_COMPILE( + m4_ifval([$4],${rbcv_cond+[@%:@if ]$rbcv_cond}) +[@%:@define ]attrib[](attrib_params)[ $mac] +m4_ifval([$4],${rbcv_cond+[@%:@else]} +${rbcv_cond+[@%:@define ]attrib[](attrib_params)[ x]} +${rbcv_cond+[@%:@endif]}) +$6 +@%:@define mesg ("") + attrib[](attrib_params)[;], [], + [rbcv="$mac"; break]) +done +])]) +AS_IF([test "$rbcv" != x], [ + RUBY_DEFINE_IF(m4_ifval([$4],[${rbcv_cond}]), attrib[](attrib_params)[], $rbcv) +]) +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 +])dnl |