Skip to content

Commit

Permalink
CentOS 7's pkg-config doesn't have --define-prefix
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Oct 5, 2022
1 parent 0d1aa4d commit d7e0371
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions r/configure
Original file line number Diff line number Diff line change
Expand Up @@ -174,13 +174,19 @@ else
if [ -d "$LIB_DIR" ]; then
# Use pkg-config to do static linking of libarrow's dependencies
export PKG_CONFIG_PATH="${LIB_DIR}/pkgconfig${PKG_CONFIG_PATH:+:${PKG_CONFIG_PATH}}"
# --define-prefix is for binary packages. Binary packages uses
# "/arrow/r/libarrow/dist" as prefix but it doesn't match this
# path. --define-prefix uses a directory that arrow.pc exists
# as its prefix instead of "/arrow/r/libarrow/dist".
PKG_CFLAGS="`pkg-config --define-prefix --cflags --static --silence-errors ${PKG_CONFIG_NAME}` $PKG_CFLAGS"
PKG_DIRS="`pkg-config --define-prefix --libs-only-L --static --silence-errors ${PKG_CONFIG_NAME}`"
PKG_LIBS="`pkg-config --define-prefix --libs-only-l --libs-only-other --static --silence-errors ${PKG_CONFIG_NAME}`"
PKG_CONFIG="pkg-config"
if ${PKG_CONFIG} --help | grep -- --define-prefix >/dev/null 2>&1; then
# --define-prefix is for binary packages. Binary packages
# uses "/arrow/r/libarrow/dist" as prefix but it doesn't
# match the extracted path. --define-prefix uses a directory
# that arrow.pc exists as its prefix instead of
# "/arrow/r/libarrow/dist".
PKG_CONFIG="${PKG_CONFIG} --define-prefix"
fi
PKG_CONFIG="${PKG_CONFIG} --static --silence-errors"
PKG_CFLAGS="`${PKG_CONFIG} --cflags ${PKG_CONFIG_NAME}` $PKG_CFLAGS"
PKG_DIRS="`${PKG_CONFIG} --libs-only-L ${PKG_CONFIG_NAME}`"
PKG_LIBS="`${PKG_CONFIG} --libs-only-l --libs-only-other ${PKG_CONFIG_NAME}`"
fi
fi
fi
Expand Down

0 comments on commit d7e0371

Please sign in to comment.