support FreeBSD 11-RELEASE

This commit is contained in:
Yuichiro NAITO 2016-11-04 15:55:31 +09:00
parent 8ef0c34cdb
commit d0c91c935e

View file

@ -553,6 +553,7 @@ build_package_standard() {
local PACKAGE_CFLAGS="${package_var_name}_CFLAGS"
[ "$package_var_name" = "RUBY" ] && use_homebrew_readline || true
[ "$package_var_name" = "RUBY" ] && use_freebsd_pkg || true
( if [ "${CFLAGS+defined}" ] || [ "${!PACKAGE_CFLAGS+defined}" ]; then
export CFLAGS="$CFLAGS ${!PACKAGE_CFLAGS}"
@ -918,6 +919,22 @@ use_homebrew_yaml() {
fi
}
use_freebsd_pkg() {
# check if FreeBSD 11-R or later
if [ "FreeBSD" = "$(uname -s)" ]; then
if [ "$(uname -r | sed 's/[^[:digit:]].*//')" -ge 11 ]; then
if $(pkg info -e libedit); then
# use if libedit is installed
package_option ruby configure --enable-libedit
package_option ruby configure --with-libedit-dir="/usr/local"
elif $(pkg info -e readline); then
# use if readline is installed
package_option ruby configure --with-readline-dir="/usr/local"
fi
fi
fi
}
use_homebrew_readline() {
if [[ "$RUBY_CONFIGURE_OPTS" != *--with-readline-dir=* ]]; then
local libdir="$(brew --prefix readline 2>/dev/null || true)"