diff --git a/ChangeLog b/ChangeLog index 693b2b60b9..8d9203e5a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,6 @@ -Thu Jul 22 12:30:52 2010 Nobuyoshi Nakada +Thu Jul 22 12:58:12 2010 Nobuyoshi Nakada + + * configure.in (RUBY_EXTERN): ignore invalid attribute. * configure.in: fix for older autoconf. diff --git a/configure.in b/configure.in index 28356b50e8..7c43cab170 100644 --- a/configure.in +++ b/configure.in @@ -676,6 +676,21 @@ EOH ])dnl ])dnl +AC_DEFUN([RUBY_WERROR_FLAG], [dnl +if test "${ac_c_werror_flag+set}"; then + rb_c_werror_flag="$ac_c_werror_flag" +else + unset rb_c_werror_flag +fi +ac_c_werror_flag=yes +$1 +if test "${rb_c_werror_flag+set}"; then + ac_c_werror_flag="$rb_c_werror_flag" +else + unset ac_c_werror_flag +fi]) + +dnl RUBY_FUNC_ATTRIBUTE(attrib, macroname, cachevar, condition) AC_DEFUN([RUBY_FUNC_ATTRIBUTE], [dnl m4_ifval([$2], dnl [AS_VAR_PUSHDEF([attrib],[$2])], dnl @@ -688,12 +703,7 @@ m4_ifval([$3], dnl m4_ifval([$4], [rbcv_cond=[$4]; test "$rbcv_cond" || unset rbcv_cond]) AC_CACHE_CHECK(for [$1] function attribute, rbcv, [rbcv=x -if test "${ac_c_werror_flag+set}"; then - rb_c_werror_flag="$ac_c_werror_flag" -else - unset rb_c_werror_flag -fi -ac_c_werror_flag=yes +RUBY_WERROR_FLAG([ for mac in "__attribute__ (($1)) x" "x __attribute__ (($1))" "__declspec($1) x" x; do m4_ifval([$4],mac="$mac"${rbcv_cond+" /* only if $rbcv_cond */"}) AC_TRY_COMPILE( @@ -705,12 +715,7 @@ ${rbcv_cond+[@%:@endif]}) attrib[(void conftest_attribute_check(void));], [], [rbcv="$mac"; break]) done -if test "${rb_c_werror_flag+set}"; then - ac_c_werror_flag="$rb_c_werror_flag" -else - unset ac_c_werror_flag -fi -]) +])]) if test "$rbcv" != x; then RUBY_DEFINE_IF([${rbcv_cond}], attrib[(x)], $rbcv) fi @@ -745,12 +750,14 @@ fi AC_CACHE_CHECK([for RUBY_EXTERN], rb_cv_ruby_extern, [rb_cv_ruby_extern=no +RUBY_WERROR_FLAG([ for mac in "__attribute__((dllimport))" "__declspec(dllimport)"; do AC_TRY_COMPILE( [extern $mac void conftest(void);], [conftest();], [rb_cv_ruby_extern="extern $mac"; break]) done]) +]) test "x$rb_cv_ruby_extern" = xno || AC_DEFINE_UNQUOTED(RUBY_EXTERN, $rb_cv_ruby_extern) RUBY_APPEND_OPTION(XCFLAGS, -DRUBY_EXPORT)