summaryrefslogtreecommitdiff
path: root/lib/mkmf.rb
AgeCommit message (Collapse)Author
2023-01-09mkmf.rb: Refine message from `pkg_config`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7088
2023-01-09mkmf.rb: Prefer `caller_locations` over parsing `caller`Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7088
2023-01-06mkmf.rb: Refactor splitting configure_args and remove duplicate codeNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/7076
2022-12-15[Bug #19189] Fallback to the default "pkg-config"Nobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6927
2022-12-05Clean compiler intermediate files moreNobuyoshi Nakada
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-10-24Set timestamp path for the target path to TARGET_SO_DIR_TIMESTAMPNobuyoshi Nakada
2022-10-02Fallback PKG_CONFIG to the configured pkg-config alwaysNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/6482
2022-09-17[Bug #19005] dynamic_lookup linker option in external librariesNobuyoshi Nakada
The warning against `-undefined dynamic_lookup` is just a warning yet, and many gems seem to pay no attention to warnings. Until it fails actually, keep it as a migration path, except for standard extension libraries and bundled extension gems. Notes: Merged: https://github.com/ruby/ruby/pull/6394 Merged-By: nobu <nobu@ruby-lang.org>
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-05-12mkmf: Add a configure option to set verbose mode (V=1 or 0) in mkmf.rb.Jun Aruga
Note this change is only for `configure.ac`, not for Windows using `win32/configure.bat`. ``` $ ./configure --help | grep mkmf --enable-mkmf-verbose enable verbose in mkmf ``` Run the following command to enable the mkmf verbose mode. ``` $ ./configure --enable-mkmf-verbose $ grep MKMF_VERBOSE config.status S["MKMF_VERBOSE"]="1" ``` In this mkmf verbose mode, when compiling a native extension, the `rake compile` prints the compiling commands such as "gcc -I. <...> path/to/file" instead of "compiling path/to/file". ``` $ git clone https://github.com/deivid-rodriguez/byebug.git $ cd byebug $ bundle install --standalone $ bundle exec rake compile ... gcc -I. <...> path/to/file ... ``` Notes: Merged: https://github.com/ruby/ruby/pull/5879
2022-04-26Use compiled instead of compliedKaíque Kandy Koga
Capitalize creates Notes: Merged: https://github.com/ruby/ruby/pull/5848
2022-04-23Remove unnecessary sortKazuhiro NISHIYAMA
Because `Dir.[]` returns the sorted results since Ruby 3.0. Notes: Merged: https://github.com/ruby/ruby/pull/5832
2022-04-05Document MakeMakefile#append_cflagsAlan Wu
This method is at least 7 years old and is widely used in the wild. Since we need to support it, let's document it to make it discoverable. Add docs and move it out of the `# :stopdoc:` zone. Notes: Merged: https://github.com/ruby/ruby/pull/5760
2022-03-20[DOC] make internally used classes/methods nodocNobuyoshi Nakada
Empty class documents are generated even with `:stopdoc:`.
2022-03-17Make implicit function declaration error [Feature #18615]Nobuyoshi Nakada
Enable `-Werror=implicit-function-declaration` by default for building C extensions for early failures.
2022-01-29mkmf: unify duplicate code in pkg_configNobuyoshi Nakada
2022-01-29mkmf: pkg_config accepts multiple optionsMike Dalessio
Notes: Merged: https://github.com/ruby/ruby/pull/5436
2021-12-10Prefer flat_mapNobuyoshi Nakada
2021-11-26mkmf: take `PKG_CONFIG_PATH` from `dir_config` library pathNobuyoshi Nakada
So that version dependent pkg-config files can override files in the default locations. Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: deal with environment variables in MakeMakefile#xpopenNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-11-26mkmf: MakeMakefile#xpopen may be passed an option hashNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/5182
2021-10-15Make explicit opening filesNobuyoshi Nakada
2021-10-03Revert "mkmf.rb: try linking at try_var" [Bug #18235]Nobuyoshi Nakada
This reverts commit 524513be399e81bb170ec88aa0d501f33cbde8c3, which can return false positive by existing but unusable symbol, including functions.
2021-09-02Get rid of incompatible-pointer-types-discards-qualifiers warningNobuyoshi Nakada
2021-07-08mkmf.rb: try linking at try_varNobuyoshi Nakada
To check for variables accessible but not declared.
2021-07-03Library arguments to VC are bare file namesNobuyoshi Nakada
2021-07-03Use $ignore_error defined in mkmf.rbNobuyoshi Nakada
2021-06-24Remove also debug symbol directory at clean on macOSNobuyoshi Nakada
2021-06-24Prefer configured command as RM_RFNobuyoshi Nakada
2021-04-11mkmf.rb: convert also arch_hdrdir [Bug #16651]Nobuyoshi Nakada
2021-03-30mkmf: fixed install directories of header files in extension libraries [Bug ↵Nobuyoshi Nakada
#17761] When installing an extension library which provides a header, that header should be installed under site_ruby (or vendor_ruby when "--vendor" option was given to extconf.rb). However, currently this file is about to be installed in the core include directory. Notes: Merged: https://github.com/ruby/ruby/pull/4339 Merged-By: nobu <nobu@ruby-lang.org>
2021-02-20MSys is a variant of CygwinNobuyoshi Nakada
2021-01-19Replace "iff" with "if and only if"Gannon McGibbon
iff means if and only if, but readers without that knowledge might assume this to be a spelling mistake. To me, this seems like exclusionary language that is unnecessary. Simply using "if and only if" instead should suffice. Notes: Merged: https://github.com/ruby/ruby/pull/4035
2021-01-14mkmf.rb: remove exts.mk at distcleanNobuyoshi Nakada
2021-01-02mkmf.rb: always try_compile as try_headerNobuyoshi Nakada
Get rid of "present but cannot be compiled" headers, on some multi-architecture platforms.
2020-12-29transcode-tblgen.rb: make silent a little when just -vNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/4011
2020-10-27Separate `send` into `public_send` and `__send__`Nobuyoshi Nakada
2020-07-13Make the mkmf methods private in the global [Bug #16896]Nobuyoshi Nakada
2020-04-05Added tooldir variableNobuyoshi Nakada
Notes: Merged: https://github.com/ruby/ruby/pull/3003
2020-03-08Specify explicit separator not to be affected by $;Nobuyoshi Nakada
2019-09-19Added link_command for C++Nobuyoshi Nakada
2019-09-19Separate @have_devel for C++Nobuyoshi Nakada
2019-09-19Look up the language moduleNobuyoshi Nakada
Look up language module with `MakeMakefile.[]`, insted of a accessing constant under that module directly, to get rid of expose the constant to the toplevel inadvertently.
2019-09-18Removed MakeMakefile::CNobuyoshi Nakada
It is exposed to the topleven namespace via included MakeMakefile.
2019-09-18Removed a debug print [ci skip]Nobuyoshi Nakada
2019-09-18[EXPERIMENTAL] MakeMakefile::CXX for C++Nobuyoshi Nakada
2019-07-23Make pkg_config in mkmf include -I cflags in return valueJeremy Evans
This was the historical behavior, it was modified unintentionally by 097c3e9cbbf23718371f08c24b2d2297b039f63f, which started storing these flags in a different global variable. Also, include the incflags when logging, and document that the method modifies $INCFLAGS. Fixes [Bug #10651]
2019-05-23Suppress paranoid warnings for external/3rd-party librariesNobuyoshi Nakada
[Feature #15665]