Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search Homebrew's prefix on Apple Silicon #51

Merged
merged 1 commit into from
Mar 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,12 @@ Ruby header files installed such as those provided by the [ruby-dev][] package
on Debian and Ubuntu.

You can then install the library via RubyGems with `gem install re2` or `gem
install re2 -- --with-re2-dir=/opt/local/re2` if re2 is not installed in the
default location of `/usr/local/`.
install re2 -- --with-re2-dir=/path/to/re2/prefix` if re2 is not installed in
any of the following default locations:

* `/usr/local`
* `/opt/homebrew`
* `/usr`

Documentation
-------------
Expand Down
14 changes: 13 additions & 1 deletion ext/re2/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,19 @@
RbConfig::CONFIG["CXX"] = ENV["CXX"]
end

incl, lib = dir_config("re2", "/usr/local/include", "/usr/local/lib")
header_dirs = [
"/usr/local/include",
"/opt/homebrew/include",
"/usr/include"
]

lib_dirs = [
"/usr/local/lib",
"/opt/homebrew/lib",
"/usr/lib"
]

dir_config("re2", header_dirs, lib_dirs)

$CFLAGS << " -Wall -Wextra -funroll-loops"

Expand Down