This is an automated email from the ASF dual-hosted git repository.

wesm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/master by this push:
     new 974b723  ARROW-4933: [R] Autodetect Parquet support using pkg-config
974b723 is described below

commit 974b7232bf2920c4a43af685964a005f40dce456
Author: Uwe L. Korn <[email protected]>
AuthorDate: Sun Mar 17 10:11:16 2019 -0500

    ARROW-4933: [R] Autodetect Parquet support using pkg-config
    
    Kudos go to @kou for this.
    
    Author: Uwe L. Korn <[email protected]>
    
    Closes #3946 from xhochy/ARROW-4933 and squashes the following commits:
    
    abc7d4083 <Uwe L. Korn> 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 19f4d2c..f0c6d49 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="<arrow/api.h>"
-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

Reply via email to