Skip to content

Commit

Permalink
[R-package] Avoid bashisms (non-POSIX code) in R-package/configure (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
smoser authored Dec 12, 2024
1 parent 186c7cd commit 53e0ddf
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions R-package/configure
Original file line number Diff line number Diff line change
Expand Up @@ -1789,7 +1789,7 @@ ${CXX} ${CPPFLAGS} ${CXXFLAGS} -o conftest conftest.cpp 2>/dev/null && ./conftes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ac_mmprefetch}" >&5
printf "%s\n" "${ac_mmprefetch}" >&6; }
if test "${ac_mmprefetch}" = yes; then
LGB_CPPFLAGS+=" -DMM_PREFETCH=1"
LGB_CPPFLAGS="${LGB_CPPFLAGS} -DMM_PREFETCH=1"
fi

############
Expand Down Expand Up @@ -1824,7 +1824,7 @@ ${CXX} ${CPPFLAGS} ${CXXFLAGS} -o conftest conftest.cpp 2>/dev/null && ./conftes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ac_mm_malloc}" >&5
printf "%s\n" "${ac_mm_malloc}" >&6; }
if test "${ac_mm_malloc}" = yes; then
LGB_CPPFLAGS+=" -DMM_MALLOC=1"
LGB_CPPFLAGS="${LGB_CPPFLAGS} -DMM_MALLOC=1"
fi

##########
Expand All @@ -1850,11 +1850,11 @@ then
# If Homebrew is found and libomp was installed with it, this code adds the necessary
# flags for the compiler to find libomp headers and for the linker to find libomp.dylib.
HOMEBREW_LIBOMP_PREFIX=""
if command -v brew &> /dev/null; then
if command -v brew >/dev/null 2>&1; then
ac_brew_openmp=no
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether OpenMP was installed via Homebrew" >&5
printf %s "checking whether OpenMP was installed via Homebrew... " >&6; }
brew --prefix libomp &>/dev/null && ac_brew_openmp=yes
brew --prefix libomp >/dev/null 2>&1 && ac_brew_openmp=yes
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: ${ac_brew_openmp}" >&5
printf "%s\n" "${ac_brew_openmp}" >&6; }
if test "${ac_brew_openmp}" = yes; then
Expand Down
8 changes: 4 additions & 4 deletions R-package/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ AC_LANG_CONFTEST(
${CXX} ${CPPFLAGS} ${CXXFLAGS} -o conftest conftest.cpp 2>/dev/null && ./conftest && ac_mmprefetch=yes
AC_MSG_RESULT([${ac_mmprefetch}])
if test "${ac_mmprefetch}" = yes; then
LGB_CPPFLAGS+=" -DMM_PREFETCH=1"
LGB_CPPFLAGS="${LGB_CPPFLAGS} -DMM_PREFETCH=1"
fi

############
Expand All @@ -86,7 +86,7 @@ AC_LANG_CONFTEST(
${CXX} ${CPPFLAGS} ${CXXFLAGS} -o conftest conftest.cpp 2>/dev/null && ./conftest && ac_mm_malloc=yes
AC_MSG_RESULT([${ac_mm_malloc}])
if test "${ac_mm_malloc}" = yes; then
LGB_CPPFLAGS+=" -DMM_MALLOC=1"
LGB_CPPFLAGS="${LGB_CPPFLAGS} -DMM_MALLOC=1"
fi

##########
Expand All @@ -112,10 +112,10 @@ then
# If Homebrew is found and libomp was installed with it, this code adds the necessary
# flags for the compiler to find libomp headers and for the linker to find libomp.dylib.
HOMEBREW_LIBOMP_PREFIX=""
if command -v brew &> /dev/null; then
if command -v brew >/dev/null 2>&1; then
ac_brew_openmp=no
AC_MSG_CHECKING([whether OpenMP was installed via Homebrew])
brew --prefix libomp &>/dev/null && ac_brew_openmp=yes
brew --prefix libomp >/dev/null 2>&1 && ac_brew_openmp=yes
AC_MSG_RESULT([${ac_brew_openmp}])
if test "${ac_brew_openmp}" = yes; then
HOMEBREW_LIBOMP_PREFIX=`brew --prefix libomp`
Expand Down

0 comments on commit 53e0ddf

Please sign in to comment.