Skip to content

Commit

Permalink
Merge pull request #51 from mudge/add-apple-silicon-homebrew-prefix-t…
Browse files Browse the repository at this point in the history
…o-default-search

Search Homebrew's prefix on Apple Silicon
  • Loading branch information
mudge authored Mar 12, 2021
2 parents d689dda + d1c4ad2 commit 9d6c9f0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
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

0 comments on commit 9d6c9f0

Please sign in to comment.