aboutsummaryrefslogtreecommitdiffstats
path: root/ext/fiddle/extconf.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/fiddle] Suppress -Wundef warnings on arm64 macOS and WindowsNobuyoshi Nakada2023-09-171-0/+5
| | | | | | | | | | | | | | (https://github.com/ruby/fiddle/pull/134) ``` In file included from ../../../../ext/fiddle/fiddle.h:46: /opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef] ^ ``` c.f. https://github.com/libffi/libffi/pull/796 https://github.com/ruby/fiddle/commit/d4feb57098
* Merge fiddle-1.1.1Hiroshi SHIBATA2022-12-091-1/+1
|
* Add --with-libffi-source-dir feature and removed --enable-bundled-libffi ↵Hiroshi SHIBATA2022-10-071-22/+6
| | | | | | | | | option. (#113) https://bugs.ruby-lang.org/issues/18571 Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org> Co-authored-by: Sutou Kouhei <kou@clear-code.com>
* Do not need to print to stderrKoichi Sasada2022-01-261-1/+1
|
* [ruby/fiddle] Add Fiddle::Handle#file_name ↵Kenta Murata2021-07-141-1/+4
| | | | | | (https://github.com/ruby/fiddle/pull/88) https://github.com/ruby/fiddle/commit/4ee1c6fc4b
* [ruby/fiddle] Use have_header and have_type to detect memory view availabilitySutou Kouhei2021-07-131-4/+0
| | | | | | | | | | | | | | Fix https://github.com/ruby/fiddle/pull/84 It may detect ruby/memory_view.h for system Ruby that is installed in /usr. We can use RUBY_API_VERSION_MAJOR to detect memory view availability because memory view is available since Ruby 3.0. Reported by Jun Aruga. Thanks!!! https://github.com/ruby/fiddle/commit/3292929830
* [ruby/fiddle] windows: link to ws2_32 for WSAGetLastError()Sutou Kouhei2021-05-181-0/+2
| | | | https://github.com/ruby/fiddle/commit/e9955d74ae
* [ruby/fiddle] Add --enable-debug-build option to extconf.rbSutou Kouhei2021-05-181-0/+41
| | | | https://github.com/ruby/fiddle/commit/e0498e60ea
* fiddle: Update to 1.0.5Sutou Kouhei2020-12-231-2/+4
|
* Import fiddle-1.0.4 (#3860)Kenta Murata2020-12-111-1/+6
| | | | | | | | I don't use tool/sync_default_gem.rb because the last sync was incomplete. Co-authored-by: Hiroshi SHIBATA <hsbt@ruby-lang.org> Co-authored-by: Alan Wu <XrXr@users.noreply.github.com> Co-authored-by: sinisterchipmunk <sinisterchipmunk@gmail.com> Co-authored-by: Sutou Kouhei <kou@clear-code.com>
* [ruby/fiddle] try bundled libffi by defaultNobuyoshi Nakada2020-06-281-1/+1
| | | | | If no installed libffi found, use bundled libffi unless explicitly `--disable-bundled-libffi` option is given.
* [ruby/fiddle] Support MSWIN (#43)Sutou Kouhei2020-06-271-30/+44
| | | | https://github.com/ruby/fiddle/commit/f16e7ff6e0
* [ruby/fiddle] Add support for variadic argumentsSutou Kouhei2020-06-271-0/+2
| | | | | | | | GitHub: fix GH-39 Reported by kojix2. Thanks!!! https://github.com/ruby/fiddle/commit/6c4cb904dc
* ext/fiddle/extconf.rb: Fix the condition of libffi <= 3.1Yusuke Endoh2020-05-131-1/+1
| | | | ver is [3, 1, 0] which is not less then or equal to [3, 1]
* Do not try ffi_closure_alloc if libffi is <= 3.1Yusuke Endoh2020-05-131-0/+1
| | | | | | | | | | Maybe due to e1855100e46040e73630b378974c17764e0cccee, CentOS, RHEL, and Fedora CIs have started failing with SEGV. Try to avoid ffi_closure_alloc on those environments. https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos8/ruby-master/log/20200512T183004Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/fedora32/ruby-master/log/20200512T183004Z.fail.html.gz https://rubyci.org/logs/rubyci.s3.amazonaws.com/rhel8/ruby-master/log/20200512T183003Z.fail.html.gz
* ext/fiddle/extconf.rb: check if ffi_closure_alloc is availableYusuke Endoh2020-05-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | to define HAVE_FFI_CLOSURE_ALLOC. The macro is used in closure.c, so have_func check is needed. If pkg-config is not installed, extconf.rb fails to detect the version of libffi, and does not add "-DUSE_FFI_CLOSURE_ALLOC=1" even when system libffi version is >= 3.2. If USE_FFI_CLOSURE_ALLOC is not defined, closure.c attempts to check if HAVE_FFI_CLOSURE_ALLOC is defined or not, but have_func was removed with 528a3a17977aa1843a26630c96635c3cb161e729, so the macro is always not defined. This resulted in this deprecation warning: https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu2004/ruby-master/log/20200512T123003Z.log.html.gz ``` compiling closure.c closure.c: In function 'initialize': closure.c:265:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations] 265 | result = ffi_prep_closure(pcl, cif, callback, (void *)self); | ^~~~~~ In file included from ./fiddle.h:42, from closure.c:1: /usr/include/x86_64-linux-gnu/ffi.h:334:1: note: declared here 334 | ffi_prep_closure (ffi_closure*, | ^~~~~~~~~~~~~~~~ ```
* Show libffi version only if setNobuyoshi Nakada2020-03-211-1/+1
|
* Fixed a typoNobuyoshi Nakada2020-03-051-1/+1
|
* [ruby/fiddle] always use ffi_closure_alloc on WindowsNobuyoshi Nakada2020-03-051-1/+6
|
* [ruby/fiddle] use ffi_closure_alloc only with 3.2 or laterNobuyoshi Nakada2020-03-041-4/+2
|
* [ruby/fiddle] ffi_closure_free is available in the bundled libffiNobuyoshi Nakada2020-03-041-1/+3
|
* [ruby/fiddle] Use ffi_closure_free if availableNobuyoshi Nakada2020-03-041-2/+3
|
* Revert "Revert "Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"""Yusuke Endoh2020-03-041-6/+14
| | | | | | | | | | | | | | | | | | | | This reverts commit 87f6154bb4c67ca77ee353bb1fe25a922036c0e5. It turned out that the change fails to build on macOS https://rubyci.org/logs/rubyci.s3.amazonaws.com/osx1014/ruby-master/log/20200304T074503Z.fail.html.gz ``` + make 'TESTS=--hide-skip -v fiddle' RUBYOPT=-w test-all dyld: lazy symbol binding failed: Symbol not found: _ffi_closure_alloc Referenced from: /Users/hsbt/Documents/cb/tmp/build/20200304T074503Z/ruby/.ext/x86_64-darwin18/fiddle.bundle Expected in: flat namespace dyld: Symbol not found: _ffi_closure_alloc Referenced from: /Users/hsbt/Documents/cb/tmp/build/20200304T074503Z/ruby/.ext/x86_64-darwin18/fiddle.bundle Expected in: flat namespace make: *** [yes-test-all] Abort trap: 6 ```
* Revert "Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)""Yusuke Endoh2020-03-041-14/+6
| | | | | | | | | | | | | | | This reverts commit efd641ffab34e433a8d8a7d78914576f2425aa90. This changeset seems to be needed to suppress a warning on Ubuntu 20.04 https://rubyci.org/logs/rubyci.s3.amazonaws.com/ubuntu/ruby-master/log/20200304T033004Z.log.html.gz ``` closure.c:264:5: warning: 'ffi_prep_closure' is deprecated: use ffi_prep_closure_loc instead [-Wdeprecated-declarations] 264 | result = ffi_prep_closure(pcl, cif, callback, (void *)self); | ^~~~~~ ``` I guess there was a reason why the commit was reverted (maybe some CIs failed?), so try it again.
* Revert "[ruby/fiddle] Use ffi_closure_free by default. (#20)"Hiroshi SHIBATA2019-10-241-6/+14
| | | | This reverts commit ce6caade7c57a505f73086ccd7b33c14f7715f22.
* [ruby/fiddle] Use ffi_closure_free by default. (#20)Vít Ondruch2019-10-241-14/+6
| | | | | | | | | | | | | | | | | | | | | * Use ffi_closure_free unconditionally. The current conditionals reflect historic heritage of FFI. Usage of ffi_closure_free should be better default nowadays, because libffi 3.0.5 fixing issues of ffi_closure_free should be widely available. * RUBY_LIBFFI_MODVERSION is not used anymore. Because `ffi_closure_free()` is not used unconditionally, there is no other use for RUBY_LIBFFI_MODVERSION define, so drop its usage. * Use more meaningful variable name. `ver` variable used to be used to pupulate RUBY_LIBFFI_MODVERSION define. Since the define was removed, the `libffi_dir` variable name should better describe the remaining usage of the variable. https://github.com/ruby/fiddle/commit/c49cc79eb8
* fix typo.tadd2018-10-201-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65212 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge fiddle from github repository.hsbt2018-10-201-0/+10
| | | | | | * ext/fiddle/extconf.rb: It supports to build libffi with standalone gem. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Merge fiddle-1.0.0.beta2 from upstream.hsbt2017-09-121-4/+4
| | | | | | | | | * ext/fiddle/closure.c: use directly declaration for standalone gem without internal.h. * Specify frozen string literal is true. * Update gemspec configuration for release version. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59854 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: fix $(SUBMAKE_PRE)nobu2017-02-101-2/+2
| | | | | | | | * ext/fiddle/extconf.rb: fix $(SUBMAKE_PRE) to chdir to $(LIBFFI_DIR) instead of $(@D), since $(LIBFFI_A) is not underneath libffi but under .libs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57593 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: jobserver for libffinobu2017-02-091-3/+4
| | | | | | | * ext/fiddle/depend (libffi): use $(MAKE) explicitly for recursive make, so that jobserver works. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57583 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* handle ext/ as r53141naruse2015-12-161-0/+1
| | | | | | | | g -L frozen_string_literal ext/**/*.rb|xargs ruby -Ka -e'ARGV.each{|fn|puts fn;open(fn,"r+"){|f|s=f.read.sub(/\A(#!.*\n)?(#.*coding.*\n)?/,"\\&# frozen_string_literal: false\n");f.rewind;f.write s}}' git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53143 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: release GVL for ffi_callnormal2015-11-231-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some external functions I wish to call may take a long time and unnecessarily block other threads. This may lead to performance regressions for fast functions as releasing/acquiring the GVL is not cheap, but can improve performance for long-running functions in multi-threaded applications. This also means we must reacquire the GVL when calling Ruby-defined callbacks for Fiddle::Closure, meaning we must detect whether the current thread has the GVL by exporting ruby_thread_has_gvl_p in internal.h * ext/fiddle/function.c (struct nogvl_ffi_call_args): new struct for GVL release (nogvl_ffi_call): new function (function_call): adjust for GVL release [ruby-core:71642] [Feature #11607] * ext/fiddle/closure.c (struct callback_args): new struct for GVL acquire (with_gvl_callback): adjusted original callback function (callback): wrapper for conditional GVL acquire * ext/fiddle/depend: add dependencies * ext/fiddle/extconf.rb: include top_srcdir for internal.h * internal.h (ruby_thread_has_gvl_p): expose for fiddle * vm_core.h (ruby_thread_has_gvl_p): moved to internal.h * test/fiddle/test_function.rb (test_nogvl_poll): new test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52723 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: $LOCAL_LIBS needs to be expandednobu2015-07-291-1/+1
| | | | | | | * ext/fiddle/extconf.rb: revert part of r51401 and expand $LOCAL_LIBS as it will be extracted and copied to exts.mk. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51429 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: unexpand LIBFFI_DIRnobu2015-07-271-3/+4
| | | | | | * ext/fiddle/extconf.rb: use LIBFFI_DIR instead of expanding it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* libff: fix enable-shared conditionnobu2015-03-131-1/+1
| | | | | | | | | | * ext/fiddle/extconf.rb: needs --enable-shared when linked to libruby or fiddle.so. since --with-static-linked-ext does no longer link extensions to ruby program with --enable-shared, the only combination needs --enable-static is --disable-shared and --with-static-linked-ext. [ruby-dev:48901] [Bug #10960] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: --disable-bundled-libffinobu2015-01-171-2/+4
| | | | | | | * ext/fiddle/extconf.rb: disable bundled libffi if explicitly disabled by --disable-bundled-libffi. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49300 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: check assemblernobu2015-01-111-0/+3
| | | | | | * ext/fiddle/extconf.rb: requires assembler for src/win{32,64}.S. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: append libffi config.lognobu2014-12-301-1/+7
| | | | | | * ext/fiddle/extconf.rb: copy config.log of libffi when failed. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49070 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: libffi PIC objectsnobu2014-12-251-2/+3
| | | | | | | * ext/fiddle/extconf.rb: make PIC objects if it will be linked as a shared object eventually. [ruby-core:67128] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: win32/libffi-config.rbnobu2014-12-241-19/+24
| | | | | | | * ext/fiddle/win32/libffi-config.rb: generate necessary files to build on mswin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/fiddle/extconf.rb: remove ffitarget.h generated by configure onusa2014-12-241-0/+3
| | | | | | | | mswin, because it's not normal file (cygwin's symlink) and have system attribute. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48954 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: no empty CPPnobu2014-12-231-1/+1
| | | | | | | * ext/fiddle/extconf.rb: pass CPP only if necessary, should not make it empty. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48933 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extmk.rb: replace current directory namenobu2014-12-231-3/+1
| | | | | | | | * ext/extmk.rb (extmake): replace "./" at beginning in LOCAL_LIBS with the current directory name for values cached in previous Makefile. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48932 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: clean-libffinobu2014-12-231-2/+4
| | | | | | * ext/fiddle/depend (clean-libffi): clean libffi directory. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48929 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: try modversion ff pkg_config succeedednobu2014-12-231-2/+2
| | | | | | | * ext/fiddle/extconf.rb: when pkg_config failed, module version is not available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48926 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: libffi on mswinnobu2014-12-231-8/+35
| | | | | | | * ext/fiddle/extconf.rb: try to compile libffi as mingw on mswin if possible. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: libffi with librubynobu2014-12-221-1/+4
| | | | | | | * ext/fiddle/extconf.rb: link libffi with libruby for symbols provided by ruby on some platforms, e.g. alloca. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48919 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* extconf.rb: configure libffi firstnobu2014-12-221-14/+25
| | | | | | | * ext/fiddle/extconf.rb: configure libffi for the check requires the headers. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48917 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* fiddle: modversion may be unavailablenobu2014-12-211-17/+17
| | | | | | * ext/fiddle/extconf.rb: modversion may be unavailable. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@48916 b2dd03c8-39d4-4d8f-98ff-823fe69b080e