From 974b7232bf2920c4a43af685964a005f40dce456 Mon Sep 17 00:00:00 2001 From: "Uwe L. Korn" Date: Sun, 17 Mar 2019 10:11:16 -0500 Subject: [PATCH] ARROW-4933: [R] Autodetect Parquet support using pkg-config Kudos go to @kou for this. Author: Uwe L. Korn Closes #3946 from xhochy/ARROW-4933 and squashes the following commits: abc7d4083 ARROW-4933: Autodetect Parquet support using pkg-config --- r/configure | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/r/configure b/r/configure index 19f4d2c615d02..f0c6d49d74c1a 100755 --- a/r/configure +++ b/r/configure @@ -32,13 +32,26 @@ PKG_RPM_NAME="arrow" PKG_CSW_NAME="arrow" PKG_BREW_NAME="apache-arrow" PKG_TEST_HEADER="" -PKG_LIBS="-larrow -lparquet" +PKG_LIBS="" # Use pkg-config if available pkg-config --version >/dev/null 2>&1 if [ $? -eq 0 ]; then PKGCONFIG_CFLAGS=`pkg-config --cflags --silence-errors ${PKG_CONFIG_NAME}` PKGCONFIG_LIBS=`pkg-config --libs ${PKG_CONFIG_NAME}` + PKGCONFIG_CFLAGS=$(pkg-config --cflags arrow) + if [ $? -ne 0 ]; then + echo "Apache Arrow C++ was not found using pkg-config" + exit 1 + fi + PKGCONFIG_LIBS=$(pkg-config --libs arrow) + PKGCONFIG_CFLAGS_PARQUET=$(pkg-config --cflags parquet) + if [ $? -eq 0 ]; then + PKGCONFIG_CFLAGS="${PKGCONFIG_CFLAGS} ${PKGCONFIG_CFLAGS_PARQUET} -DARROW_R_WITH_PARQUET" + PKGCONFIG_LIBS="${PKGCONFIG_LIBS} $(pkg-config --libs parquet)" + fi +else + PKG_LIBS="-larrow -lparquet" fi # Note that cflags may be empty in case of success