@@ -255,6 +255,7 @@ AS_CASE(["$build_os"],
255255 [xgcc-4.2|x/usr/bin/gcc-4.2], [: ${CXX=g++-4.2}],
256256 [xgcc|x/usr/bin/gcc], [: ${CXX=g++}],
257257 [xcc|x/usr/bin/cc], [: ${CXX=c++}],
258+ [xicc], [: ${CXX=icpc}],
258259 [xclang|x/usr/bin/clang], [: ${CXX=clang++}])
259260 ])
260261test -z "$CC" || ac_cv_prog_CC="$CC"
@@ -794,6 +795,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
794795 extra_warning=
795796 fi
796797 for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
798+ -diag-disable=2259 \
797799 -Wno-missing-field-initializers \
798800 -Wunused-variable \
799801 -Werror=pointer-arith \
@@ -866,6 +868,33 @@ if test "$GCC" = yes; then
866868 # various headers. Most frequent situation is the use of //
867869 # comments. We bypass ANSI C mode for them. Otherwise
868870 # extension libs cannot include those headers.
871+
872+ # Since math.h in some mingw64 wrongly delcares frexp and modf
873+ # to be pure, the variables pointed by the second arguments are
874+ # considered uninitialized unexpectedly.
875+ AC_CACHE_CHECK([whether frexp and modf are broken],
876+ rb_cv_mingw64_broken_frexp_modf,
877+ [
878+ save_CFLAGS="$CFLAGS"
879+ if test "$particular_werror_flags" = "yes"; then
880+ CFLAGS="$CFLAGS -Werror=uninitialized"
881+ else
882+ CFLAGS="$CFLAGS -Werror -Wuninitialized"
883+ fi
884+ AC_TRY_COMPILE([@%:@include <math.h>
885+ int foo(double x)
886+ {
887+ int exp;
888+ frexp(x, &exp);
889+ return exp;
890+ }], [if (foo(0.0)) return 1;],
891+ [rb_cv_mingw64_broken_frexp_modf=no],
892+ [rb_cv_mingw64_broken_frexp_modf=yes])
893+ CFLAGS="$save_CFLAGS"
894+ ])
895+ if test "$rb_cv_mingw64_broken_frexp_modf" = yes; then
896+ AC_DEFINE(RUBY_MINGW64_BROKEN_FREXP_MODF)
897+ fi
869898 ],
870899 [cygwin*|darwin*|netbsd*|nacl], [
871900 # need lgamma_r(), finite()
@@ -921,7 +950,7 @@ if test "$GCC" = yes; then
921950 ])
922951
923952 # disable fast-math
924- for oflag in -fno-fast-math; do
953+ for oflag in -fno-fast-math -fp-model\ precise ; do
925954 RUBY_TRY_CFLAGS($oflag, [RUBY_APPEND_OPTION(optflags, $oflag)])
926955 done
927956fi
@@ -997,6 +1026,12 @@ AS_CASE(["$target_os"],
9971026 ],
9981027 [macosx_10_5=yes], [macosx_10_5=no])
9991028 AC_MSG_RESULT($macosx_10_5)
1029+ AS_IF([test "${target_os@%:@darwin}" -ge 16], [
1030+ ac_cv_func___syscall=no
1031+ ac_cv_func_syscall=no
1032+ ac_cv_header_sys_syscall_h=no
1033+ ac_cv_header_syscall_h=no
1034+ ])
10001035 if test $macosx_10_5 = yes; then
10011036 ac_cv_func_getcontext=no
10021037 ac_cv_func_setcontext=no
@@ -3544,8 +3579,8 @@ AS_CASE("$enable_shared", [yes], [
35443579 LIBRUBY_RELATIVE=yes
35453580 fi
35463581 LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-install_name '${libprefix}'/$(LIBRUBY_SO)'
3547- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(MAJOR).$(MINOR).$(TEENY )'
3548- LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(ruby_version )'
3582+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-compatibility_version $(MAJOR).$(MINOR)'
3583+ LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-current_version $(RUBY_PROGRAM_VERSION )'
35493584 if test "$visibility_option" = ld; then
35503585 LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,_Init_*'
35513586 LIBRUBY_DLDFLAGS="$LIBRUBY_DLDFLAGS "'-Wl,-unexported_symbol,*_threadptr_*'
0 commit comments