diff --git a/README.md b/README.md index 378ccf0..88f65bc 100644 --- a/README.md +++ b/README.md @@ -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 ------------- diff --git a/ext/re2/extconf.rb b/ext/re2/extconf.rb index 4b44d90..cbb2da3 100644 --- a/ext/re2/extconf.rb +++ b/ext/re2/extconf.rb @@ -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" +] + +incl, lib = dir_config("re2", HEADER_DIRS, LIB_DIRS) $CFLAGS << " -Wall -Wextra -funroll-loops"