Skip to content

Commit

Permalink
configure.ac: replace krb5-config with pkg-config
Browse files Browse the repository at this point in the history
The rationale is that custom *-config tools don't work well when
cross-compiling or using sysroots (such as when using Yocto project) and
require custom fixing for each of them; pkg-config on the other hand
works similarly everywhere.

Signed-off-by: Roy Li <rongqing.li@windriver.com>
Signed-off-by: Alexander Kanavin <alex@linutronix.de>

Closes curl#7916
  • Loading branch information
Roy Li authored and bagder committed Oct 28, 2021
1 parent 6204aab commit 6fe4e7d
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions configure.ac
Expand Up @@ -1677,18 +1677,17 @@ AC_ARG_WITH(gssapi,
fi
])

: ${KRB5CONFIG:="$GSSAPI_ROOT/bin/krb5-config"}

save_CPPFLAGS="$CPPFLAGS"
AC_MSG_CHECKING([if GSS-API support is requested])
if test x"$want_gss" = xyes; then
AC_MSG_RESULT(yes)

CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
if test -z "$GSSAPI_INCS"; then
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
GSSAPI_INCS=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --cflags gssapi`
elif test -f "$KRB5CONFIG"; then
GSSAPI_INCS=`$KRB5CONFIG --cflags gssapi`
elif test "$PKGCONFIG" != "no" ; then
GSSAPI_INCS=`$PKGCONFIG --cflags mit-krb5-gssapi`
elif test "$GSSAPI_ROOT" != "yes"; then
GSSAPI_INCS="-I$GSSAPI_ROOT/include"
fi
Expand Down Expand Up @@ -1773,15 +1772,14 @@ if test x"$want_gss" = xyes; then
LIBS="-lgssapi_krb5 -lresolv $LIBS"
;;
*)
CURL_CHECK_PKGCONFIG(mit-krb5-gssapi)
if test -n "$host_alias" -a -f "$GSSAPI_ROOT/bin/$host_alias-krb5-config"; then
dnl krb5-config doesn't have --libs-only-L or similar, put everything
dnl into LIBS
gss_libs=`$GSSAPI_ROOT/bin/$host_alias-krb5-config --libs gssapi`
LIBS="$gss_libs $LIBS"
elif test -f "$KRB5CONFIG"; then
dnl krb5-config doesn't have --libs-only-L or similar, put everything
dnl into LIBS
gss_libs=`$KRB5CONFIG --libs gssapi`
elif test "$PKGCONFIG" != "no" ; then
gss_libs=`$PKGCONFIG --libs mit-krb5-gssapi`
LIBS="$gss_libs $LIBS"
else
case $host in
Expand Down

0 comments on commit 6fe4e7d

Please sign in to comment.