summaryrefslogtreecommitdiff
path: root/ext/extmk.rb
AgeCommit message (Collapse)Author
2023-03-02MSWin: Use MESSAGE_BEGIN/MESSAGE_END instead of bare `echo`Nobuyoshi Nakada
To strip enclosing double quotes.
2022-11-21Use class methods of `File` over `Kernel.open` and `IO.read`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6777
2022-11-16Clean extension build directories and exts.mk fileNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6741
2022-11-16Remove `-j` option from `MFLAGS` for sub-makesNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6741
2022-10-24Make the timestamp path correspond to the bundled target pathNobuyoshi Nakada
So different timestamps for different paths will be used. Extentions paths in bundled gems contain `ruby_version`, which includes the ABI version, and the same timestamp file for different paths resulted in build failures when it changed.
2022-09-20Quiet if the target is already linked the same sourceNobuyoshi Nakada
2022-08-07Create temporary file exclusively and cleanNobuyoshi Nakada
2022-08-04Resolve abi symbol references from miniruby to avoid circular depsYuta Saito
Adding `ruby` to `PREP` causes the following circular dependencies because `PREP` is used as a prerequisite by some targets required to build `ruby` target itself. ``` make: Circular .rbconfig.time <- ruby dependency dropped. make: Circular builtin_binary.inc <- ruby dependency dropped. make: Circular ext/extinit.c <- ruby dependency dropped. make: Circular ruby <- ruby dependency dropped. ``` Adding a new Make variable like `EXTPREP` only for exts may be also reasonable, but it would introduce another complexity into our build system. `-bundle_loader` doesn't care that link-time and run-time loader executables are different as long as bound symbols are provided, so it's ok to resolve from miniruby to simplify our build. Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Use $(bindir) for path to executable in mkmfAlan Wu
For the macOS -bundle_loader linker option, we need a path to the Ruby exectuable. $(RUBY) is not necessarily a path since it could be a command line invocation. That happens during build with runruby.rb and can happen post installation if the user passes the --ruby option to a extconf.rb. Use $(bindir) to locate the executable instead. Before installation, $(bindir) doesn't exist, so we need to be able to override $(BUILTRUBY) in such situations so test-spec and bundled extensions could build. Use a new mkmf global, $builtruby, to do this; set it in fake.rb and in extmk.rb. Our build system is quite complex... Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-08-04Link ext bundles with bundle loader option for newer ld64Yuta Saito
ld64 shipped with Xcode 14 emits a warning when using `-undefined dynamic_lookup`. ``` ld: warning: -undefined dynamic_lookup may not work with chained fixups ``` Actually, `-undefined dynamic_lookup` doesn't work when: 1. Link a *shared library* with the option 2. Link it with a program that uses the chained-fixup introduced from macOS 12 and iOS 15 because `-undefined dynamic_lookup` uses lazy-bindings and they won't be bound while dyld fixes-up by traversing chained-fixup info. However, we build exts as *bundles* and they are loaded only through `dlopen`, so it's safe to use `-undefined dynamic_lookup` in theory. So the warning produced by ld64 is false-positive, and it results failure of option checking in configuration. Therefore, it would be an option to ignore the warning during our configuration. On the other hand, `-undefined dynamic_lookup` is already deprecated on all darwin platforms except for macOS, so it's good time to get rid of the option. ld64 also provides `-bundle_loader <executable>` option, which allows to resolve symbols defined in the executable symtab while linking. It behaves almost the same with `-undefined dynamic_lookup`, but it makes the following changes: 1. Require that unresolved symbols among input objects must be defined in the executable. 2. Lazy symbol binding will lookup only the symtab of the bundle loader executable. (`-undefined dynamic_lookup` lookups all symtab as flat namespace) This patch adds `-bundle_loader $(RUBY)` when non-EXTSTATIC configuration by assuming ruby executable can be linked before building exts. See "New Features" subsection under "Linking" section for chained fixup https://developer.apple.com/documentation/xcode-release-notes/xcode-13-release-notes Notes: Merged: https://github.com/ruby/ruby/pull/6193
2022-07-24Make extensions under `Gem.extension_api_version` directoryNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6174
2022-07-16Avoid to symlink under symlinkNobuyoshi Nakada
2022-07-16Move copying/linking extra files to Makefile so removed by `clean`Nobuyoshi Nakada
2022-07-15Ensure symlinks to bundled gem with exts have parent dirYuta Saito
When configuring with `--disable-rpath` and `--static-linked-ext` (e.g. building for WASI), `extmk.rb` doesn't build exts under bundled gems, and `.bundle/gems/#{gemname}-#{ver}` are not created due to no call of `extmake`. b2491783986084770f6f97552f27b868622730cf starts creating symlink at `.bundle/gems/#{gemname}-#{ver}/lib`, but the parent dir is not created, so configuration aginst debug and rbs gems were failed. Notes: Merged: https://github.com/ruby/ruby/pull/6136
2022-07-14Install gems `lib` directory to build pathNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6130
2022-07-14Make dependency-free gemspec filesNobuyoshi Nakada
The default gems have not been installed yet in the build directory, bundled gems depending on them can not work. As those dependencies should be usable there even without rubygems, make temporary gemspec files without the dependencies, and use them in the build directory. Notes: Merged: https://github.com/ruby/ruby/pull/6130
2022-07-13Move timestamps directory for bundled gemsNobuyoshi Nakada
2022-04-07Move the target directory of bundled gems like as rubygemsNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5774
2022-04-07Bundled gems are expanded under `.bundle/gems` nowNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5774
2020-12-29transcode-tblgen.rb: make silent a little when just -vNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4011
2019-11-19Configure static extensions only if in chargeNobuyoshi Nakada
Get rid of races in parallel configuration when using the ext/Setup file.
2019-09-19Revert "DEBUG: dump mkmf.log"Nobuyoshi Nakada
This reverts commit 69e209a3450bd6b281dcad1d96a34e9cab184845. The debug has finishted.
2019-09-19Removed mkmf.log dump in MakefileNobuyoshi Nakada
2019-09-19DEBUG: dump mkmf.logNobuyoshi Nakada
2019-07-15catch up e8ddbc0239.Koichi Sasada
2018-12-01Let sub-directory exts depend on their parent extmrkn
* ext/extmk.rb: Let sub-directory exts depend on their parent ext. * template/exts.mk.tmpl: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-03-25extmk.rb: get rid of shadowing outer local variablenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62912 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-07extmk.rb: exclude recursivelynobu
* ext/extmk.rb: exclude extension libraries recursively. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@61643 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21ext/extmk.rb: colorize notes [Feature #13302]nobu
* common.mk (build-ext): pass variables to colorize. * ext/extmk.rb: colorize notes with tool/colorize.rb. * tool/colorize.rb: extract from tool/generic_erb.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58426 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-21exts.mk: refine notes [Feature #13302]nobu
* ext/extmk.rb: split notes into header and footer, which are common, from bodies which are unique for each extensions. * template/exts.mk.tmpl: now each notes are not one line, should not unique. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58425 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-20extmk.rb: fail for mandatory librariesnobu
* ext/extmk.rb: fail if a mandatory extension library failed to configure. [ruby-core:80759] [Feature #13302] * template/exts.mk.tmpl: move `exit` at the end. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-04-19extmk.rb: improve message printed when configuring extensions failsrhe
Point to the mkmf.log if configuring an extension fails so that people can find and fix the culprit easily. [ruby-core:80131] [Feature #13302] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-03-07suppress warning: shadowing outer local variable - enaruse
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57796 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-28clean gemsnobu
* Makefile.in (clean-ext): clean gem directories too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57743 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-02-10extmk.rb: split notesnobu
* ext/extmk.rb: split notes and echo per lines, for multiple lines messages. [ruby-core:79475] [Bug #13200] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57590 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28extmk.rb: remove clean and install modenobu
* ext/extmk.rb (parse_args): remove clean and install mode, now configure mode only. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57449 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28extmk.rb: remove direct build modenobu
* ext/extmk.rb (parse_args): --command-output is now mandatory. remove direct build mode. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57448 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-28exts.mk.tmpl: ruby namesnobu
* template/exts.mk.tmpl: extract configured ruby names. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-27extmk.rb: fix for static-linked-extnobu
* ext/extmk.rb (extmake): fix up r57424 for static-linked-ext. separate maybestatic argument from basedir which is given always now. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57441 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-26Parallel gem configurationnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23Parallel ext configurationnobu
* ext/configure-ext.mk: configure each directories underneath ext in parallel. * template/exts.mk.tmpl: then collect the results. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57401 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23extinit.c.tmpl: drop after dotnobu
* template/extinit.c.tmpl: drop rest from the first dot in the base name of a feature is ignored since r30464. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-23extmk.rb: EXTINITS to sub makenobu
* ext/extmk.rb: pass EXTINITS to sub make. if the template for extinit.c is modified after extinit.c got compiled, extinit.c will be re-generated together with ruby. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57396 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-22template/extinit.c.tmplnobu
* template/extinit.c.tmpl: separate from ext/extmk.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57395 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-01-20extmk.rb: ignore generated sourcesnobu
* ext/extmk.rb (extract_makefile): ignore generated source files not to reconfigure when in-place build. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@57385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-11-18extmk.rb: removed compiled? method [ci skip]nobu
* ext/extmk.rb (compiled?): removed. * ext/win32/extconf.rb: try to install libraries regardless fiddle. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56822 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-24install extra librariesnobu
* ext/extmk.rb (extract_makefile, extmake, configuration): store extra libraries to be installed. * tool/rbinstall.rb (ext-arch): install extra libraries. * ext/zlib/extconf.rb: install zlib if built. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56230 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-04extmk.rb: no ext, no build_completenobu
* ext/extmk.rb (create_makefile): touch gem.build_complete only if building an extension library. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56067 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-04extmk.rb: fix gem.build_complete locationnobu
* ext/extmk.rb (timestamp_file): make build_complete file at the toplevel of the gem directory without target_prefix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-09-04extmk.rb: expand target_prefixnobu
* ext/extmk.rb (timestamp_file): should expand target_prefix in timestamp file name. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e