Граф коммитов

1490 Коммитов

Автор SHA1 Сообщение Дата
nobu 6d06aadd8e Dir as base option
* dir.c (glob_helper): support Dir instance as `base` option.
  [Feature#13056]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58860 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-23 14:34:12 +00:00
nobu 48070cef94 downloader cache
* tool/downloader.rb (Downloader.download): manage download cache.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58833 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-21 16:45:35 +00:00
mame 33710d4581 Add coverage measurement mode by using gcov
This experimental feature is only for Ruby-core team, not for casual users.

Usage: `./configure --enable-gcov && make && make exam && make gcov`

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-20 13:00:41 +00:00
nobu b4939106f3 configure.in: negative time_t for mingw
* configure.in: mingw also uses MSVCRT accepts negative time_t.
  c.f. r58681.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58730 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-15 11:16:27 +00:00
nobu 062f5eb813 configure.in: remove dynamic option in LDSHARED
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58729 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-15 11:16:26 +00:00
nobu 0f4d856d4d define RUBY_DEBUG_ENV only for main.c
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58724 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-15 07:04:48 +00:00
nobu 42624856a8 tgamma on mingw
* configure.in: get rid of unreliable tgamma() implemented of
  mingw, which returns NaN unexpectedly.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58710 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-14 01:03:15 +00:00
nobu d3ca0b29a6 math.c: check argument to lgamma_r
* math.c (math_lgamma): check the argument before calling math
  function `lgamma_r` for edge cases.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58698 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-13 01:05:30 +00:00
nobu 1a4a536247 math.c: check argument to tgamma
* math.c (math_gamma): check the argument before calling math
  function `tgamma` for edge cases.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58697 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-13 00:50:20 +00:00
nobu 126aba8587 fix tgamma for inifity
* configure.in: do not use buggy tgamma() of mingw.

* missing/tgamma.c (tgamma): merge fix for inifity from
  ruby_tgamma.  since msvcr120.dll and later have tgamma, this
  implementation will not be used.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58691 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-12 16:12:46 +00:00
kazu 929807a9e0 Use `dd` instead of `head -c`
[Bug #13538] [ruby-dev:50106]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58548 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-05-03 02:02:50 +00:00
normal 7e5462b36f define PACKED_STRUCT_UNALIGNED correctly
Defining PACKED_STRUCT_UNALIGNED to a noop in ruby/config.h (via
`configure') prevents the definition in include/ruby/defines.h
from working

This should have been fixed in r46914, so there's a size
regression for some objects since Ruby 2.2+.  I do not believe
we can backport to existing releases, either, since it can
affect ABI.

Add a test for Time objects on common x86-based platforms to
check for future regressions.

* configure.in: remove PACKED_STRUCT_UNALIGNED definition
* test/ruby/test_time.rb (test_memsize): new test for x86

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58442 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-22 01:08:15 +00:00
nobu a8faecc1e6 configure.in: honor GIT env
* configure.in (--with-git): honor environment variable GIT if
  set.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58388 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-18 05:56:34 +00:00
nobu d005ada1b8 configure.in: sigsetjmp sivesigs flag
* configure.in (RUBY_SETJMP_TYPE): optional flag to save signal
  mask.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-14 12:51:46 +00:00
nobu 1c2724ab2e configure.in: need GIT to check if using git
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58311 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-11 02:40:13 +00:00
nobu b1ea4dd6a2 configure.in: detect baseruby by default
* configure.in: default HAVE_BASERUBY to yes, for auto detection.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58298 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-10 01:46:24 +00:00
nobu b68fb2efce Allow --without-baseruby option
* configure.in, win32/configure.bat: allow --without-baseruby
  option to use already generated files without baseruby.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-10 01:22:49 +00:00
nobu 0ab20b48c5 Add --with-git option
* configure.in, win32/configure.bat: add --with-git option to
  tell git command to use, or not to use git.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58295 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-10 01:22:48 +00:00
nobu 9e4da4486b configure.in: rpath with OPTDIR
* configure.in: add rpath flags which is needed for OPTDIR as well
  as -L options, when it is given.  [ruby-dev:50065] [Bug #13411]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-09 11:44:01 +00:00
shyouhei 77c26ee6a0 fix --with-gmp (broken by r57490)
Looking at the generated shell script (also the autoconf manual), it
seems AC_SEARCH_LIBS() m4 macro does not define HAVE_LIBsomething C
preprocessor macros, unlike AC_CHECK_LIB() which does define them.
This previous change effectively killed building with GMP because
building that mode depends on existence of HAVE_LIBGMP. [Bug #13402]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-05 08:52:31 +00:00
nobu 0be01189c7 configure.in: HAVE_MALLOC_CONF
* configure.in: define HAVE_MALLOC_CONF when using jemalloc.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-05 07:07:51 +00:00
nobu 8109114b18 Add IO#pread and IO#pwrite methods
These methods are useful for safe/concurrent file I/O in
multi-thread/process environments and also fairly standard
nowadays especially in systems supporting pthreads.

Based on patches by Avseyev <sergey.avseyev@gmail.com> at
[ruby-core:79290].  [Feature #4532]

* configure.in: check for pwrite(2).  pread() is already used
  internally for IO.copy_stream.

* io.c: implement wrappers for pread(2) and pwrite(2) and expose
  them in IO.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-03 00:10:50 +00:00
nobu cd80709c66 configure.in: syscall is deprecated on macOS
* configure.in: syscall is no longer supported on macOS since
  10.12.  [ruby-core:80300] [Bug #13361]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58084 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-25 07:46:12 +00:00
nobu ac3b77c98e configure.in: RUBY_SO_NAME as --with-soname
* configure.in (RUBY_SO_NAME): [EXPERIMENTAL] use the given name
  literally if --with-soname is specified.
  [ruby-core:79972] [Misc #13296]

[ci skip]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-10 05:34:27 +00:00
shyouhei 3106f9412a use HAVE_BUILTIN___BUILTIN_MUL_OVERFLOW
We already check for __builtin_mul_overflow in configure but never
actually referred it before.  Why not call it if available, because
that should render supposedly-optimial assembly outputs.

Optionally if __builtin_mul_overflow_p is available, which is the case
for recent GCC, use that to detect fixnum overflow.  This is much
faster than the previous.  On my machine generated assembly of
numeric.c:int_pow reduces from 480 to 448 bytes, according to nm(1).
Also on my machine, following script boosts from 7.819 to 6.929 sec.

time ./miniruby -e 'i=0; while i < 30_000_000 do i += 1; 7 ** 23; end'

Signed-off-by: Urabe, Shyouhei <shyouhei@ruby-lang.org>


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57784 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-06 06:04:52 +00:00
nobu 85ac60cfd1 broken mingw
* configure.in: check whether frexp and modf are broken.

* include/ruby/win32.h (frexp, modf): ignore bad declarations when
  compiling as C++.  [ruby-core:79859] [Bug #13267]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57762 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-03 04:51:34 +00:00
naruse c0837cb73a fix typo and argument of r57506
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57507 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-02 17:07:28 +00:00
naruse 038ccbd112 Use carry flag to reduce instructions
NOTE:
(1) Fixnum's LSB is always 1.
    It means you can always run `x - 1` without overflow.
(2) Of course `z = x + (y-1)` may overflow.
    Now z's LSB is always 1, and the MSB of true result is also 1.
    You can get true result in long as `(1<<63)|(z>>1)`,
    and it equals to `(z<<63)|(z>>1)` == `ror(z)`.

GCC and Clang have __builtin_add_ovewflow:
* https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html
* https://clang.llvm.org/docs/LanguageExtensions.html#checked-arithmetic-builtins

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-02 15:54:51 +00:00
nobu a106278e54 configure.in: use AC_SEARCH_LIBS
* configure.in (--with-gmp, --with-jemalloc): use AC_SEARCH_LIBS
  to check if no library is required, instead of AC_CHECK_LIB.
  [ruby-core:79368] [Bug #13175]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57490 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-01 07:40:58 +00:00
nobu c49060b1d9 Reapply r57093,r57094,r57097 "dtrace build fixes on FreeBSD"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-17 07:48:58 +00:00
nobu 6f40689356 Reapply r57092 "configure.in: repeated checks"
Needs DTRACE_OBJ when "$rb_cv_prog_dtrace_g" = rebuild, too.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-17 07:48:57 +00:00
nobu 860b42cf5a Revert r57092 "configure.in: repeated checks"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57102 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-17 05:27:05 +00:00
naruse ccdaec2fe8 Revert r57093,r57094,r57097 "dtrace build fixes on FreeBSD"
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57101 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-17 05:14:14 +00:00
nobu d4ff516f33 configure.in: fix r57093
* configure.in (RUBY_DTRACE_AVAILABLE): try -xnolibs first.
  [ruby-core:78676] [Bug #13041]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-17 00:01:42 +00:00
nobu 681c22eb09 garbage space [ci skip]
* configure.in (RUBY_DTRACE_AVAILABLE): remove a garbage space.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57094 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16 12:28:19 +00:00
nobu 756895dd0e dtrace build fixes on FreeBSD
* configure.in (RUBY_DTRACE_AVAILABLE, RUBY_DTRACE_POSTPROCESS):
  incorporate dtrace build fix on FreeBSD, dtrace needs -xnolibs
  in a jail.  [ruby-core:78676] [Bug #13041]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16 12:16:33 +00:00
nobu e341a6724e configure.in: repeated checks
* configure.in (enable_dtrace): reduce repeated
  RUBY_DTRACE_AVAILABLE checks.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57092 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16 11:59:57 +00:00
nobu 6b1e24eaa5 configure.in: no crypt.h on FreeBSD 12
* configure.in (crypt.h): crypt_r() was added in FreeBSD 12.0 but
  is declared in unistd.h.  [ruby-core:78664] [Bug #13038]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57090 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-12-16 03:30:26 +00:00
knu 673a6ad970 Reverse compatibility_version and current_version for Darwin
The `compatibility_version` should have an API version and the
`current_version` should have a program version of Ruby, but they have
been reversed and the binary compatibility has never worked.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56905 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-27 10:08:00 +00:00
nobu 708f1e74b7 configure.in: compressed debug section option
* configure.in: make compressed debug section optional.
  [ruby-core:78121] [Bug #12934]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56812 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-16 06:07:55 +00:00
shugo 53938555eb * configure.in (-Wno-maybe-uninitialized): gcc 6 also shows the same
warnings as described in r49410.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56632 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-06 06:58:25 +00:00
naruse 825e191296 * configure.in (-Wimplicit-fallthrough): gcc7 introduces case
fall through warnings but it is too noisy.
  https://gcc.gnu.org/bugzilla/show_bug.cgi?id=7652

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56603 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-05 15:05:30 +00:00
naruse 25728a1963 * configure.in: Add compiler version message into rbconfig
as RbConfig::CONFIG['CC_VERSION_MESSAGE']. [Feature #12896]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56556 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-04 06:37:09 +00:00
nobu 6c7024f6f4 file.c: include sys/sysmacros.h
* file.c: include sys/sysmacros.h for ArchLinux which deprecated
  use of major() and minor() in sys/types.h.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56549 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-03 06:02:16 +00:00
nobu 1e63aafe77 configure.in: no round in x64-mingw
* configure.in (ac_cv_func_round): round(3) in x86_64-w64-mingw32
  is not accurate in an edge case.  [ruby-core:77794] [Bug #12878]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56534 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-31 16:31:12 +00:00
nobu 5caaef7ad9 configure.in: fallback DLDFLAGS to LDFLAGS
* configure.in (DLDFLAGS): fallback to LDFLAGS.
  [ruby-core:72444] [Bug #11863]
* configure.in (LIBRUBY_DLDFLAGS): fallback to DLDFLAGS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56472 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-22 01:28:30 +00:00
nobu 5ccf58eb32 configure.in: fix RUBY_{APPEND/PREPEND}_OPTION
* configure.in (RUBY_APPEND_OPTION, RUBY_PREPEND_OPTION): expand
  the option to be appended/prepended when matching, as well as
  RUBY_APPEND_OPTIONS and  RUBY_PREPEND_OPTIONS.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56471 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-22 01:27:04 +00:00
nobu a40d95c48f configure.in: compress debug sections
* configure.in (DLDFLAGS): append --compress-debug-sections=zlib
  if available, which reduces the size of LIBRUBY_SO by half or
  more.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-18 07:36:42 +00:00
nobu 9bd2490785 install-static-library option [ci skip]
* configure.in (install-static-library): add option to enable/
  disable to install static ruby library.  defaulted to "no" if
  enable-shared.  [Feature #12845]
* tool/rbinstall.rb (local-arch-lib): respect the option.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56434 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-17 07:17:07 +00:00
shyouhei 2fc5210f31 * internal.h (WARN_UNUSED_RESULT): moved to configure.in, to
actually check its availability rather to check GCC's version.

	* configure.in (WARN_UNUSED_RESULT): moved to here.

	* configure.in (RUBY_FUNC_ATTRIBUTE): change function declaration
	  to return int rather than void, because it makes no sense for a
	  warn_unused_result attributed function to return void.

	  Funny thing however is that it also makes no sense for noreturn
	  attributed function to return int.  So there is a fundamental
	  conflict between them.  While I tested this, I confirmed both
	  GCC 6 and Clang 3.8 prefers int over void to correctly detect
	  necessary attributes under this setup.  Maybe subject to change
	  in future.

	* internal.h (UNINITIALIZED_VAR): renamed to MAYBE_UNUSED, then
	  moved to configure.in for the same reason we move
	  WARN_UNUSED_RESULT.

	* configure.in (MAYBE_UNUSED): moved to here.

	* internal.h (__has_attribute): deleted, because it has no use now.

	* string.c (rb_str_enumerate_lines): refactor macro rename.

	* string.c (rb_str_enumerate_bytes): ditto.

	* string.c (rb_str_enumerate_chars): ditto.

	* string.c (rb_str_enumerate_codepoints): ditto.

	* thread.c (do_select): ditto.

	* vm_backtrace.c (rb_debug_inspector_open): ditto.

	* vsnprintf.c (BSD_vfprintf): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-16 06:15:55 +00:00