You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by gr...@apache.org on 2019/06/10 20:58:52 UTC

[kudu] 03/03: thirdparty: fix build_curl with unusual krb5-config location

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

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

commit ec1a1f301b6f8b5ca8428d755e7658ec1c3d22a7
Author: Adar Dembo <ad...@cloudera.com>
AuthorDate: Mon Jun 10 12:25:38 2019 -0700

    thirdparty: fix build_curl with unusual krb5-config location
    
    The curl build system runs krb5-config to determine which GSSAPI headers
    and libraries are needed at build time. It expects to find krb5-config in
    /usr/bin and if it's not found, it'll default to linking with -lgssapi.
    
    On SLES12, krb5-config is in /usr/lib/mit/bin, so it isn't found and the
    curl build generally fails because -lgssapi isn't a Kudu requirement. By
    setting KRB5CONFIG we can redirect curl's build towards the correct location
    of krb5-config and get the correct libraries as a result (-lkrb5,
    -lk5crypto, and -lcom_err, if you're curious).
    
    Change-Id: Ief5816d561545945089108e34bd59c8e5dae9dc4
    Reviewed-on: http://gerrit.cloudera.org:8080/13577
    Reviewed-by: Todd Lipcon <to...@apache.org>
    Tested-by: Kudu Jenkins
---
 thirdparty/build-definitions.sh | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/thirdparty/build-definitions.sh b/thirdparty/build-definitions.sh
index 3aefe40..d156dab 100644
--- a/thirdparty/build-definitions.sh
+++ b/thirdparty/build-definitions.sh
@@ -656,6 +656,16 @@ build_curl() {
   mkdir -p $CURL_BDIR
   pushd $CURL_BDIR
 
+  # curl's configure script expects krb5-config to be in /usr/bin. If that's not
+  # the case (looking at you, SLES12's /usr/lib/mit/bin/krb5-config), we need to
+  # pass the right location via the KRB5CONFIG environment variable.
+  #
+  # TODO(adar): there's gotta be a way to do this without using export/unset.
+  KRB5CONFIG_LOCATION=$(which krb5-config)
+  if [ "$KRB5CONFIG_LOCATION" != "/usr/bin/krb5-config" ]; then
+    export KRB5CONFIG=$KRB5CONFIG_LOCATION
+  fi
+
   # Note: curl shows a message asking for CPPFLAGS to be used for include
   # directories, not CFLAGS.
   CFLAGS="$EXTRA_CFLAGS" \
@@ -681,6 +691,7 @@ build_curl() {
     --without-librtmp \
     --without-libssh2 \
     --with-gssapi
+  unset KRB5CONFIG
   make -j$PARALLEL $EXTRA_MAKEFLAGS install
   popd
 }