From 39e6f17626a138f2e22baa9bed718e4ee9ddf025 Mon Sep 17 00:00:00 2001 From: Greg Hudson Date: Mon, 26 Sep 2011 15:32:41 +0000 Subject: [PATCH] Remove CFLAGS and external deps from krb5-config --libs r15217 apparently intended to prune $(CFLAGS) from the --libs output, but actually substituted in the value from the invoker's environment. Actually prune it. Don't output external dependencies like -lresolv or -ldl in krb5-config --libs. We already don't generate output suitable for static linking because we omit -lkrb5support, and there is no expectation that bringing in the krb5 API also brings in the resolv or dl APIs for the application. We still output internal dependencies and a com_err dependency; for instance, e.g. krb5-config --libs gssapi outputs a dependency on -lkrb5 and -lk5crypto, which is inappropriate for a program using only GSSAPI interfaces. Removing internal dependencies would likely break callers who have come to depend on them, especially as we've never correctly supported things like "krb5-config --libs gssapi krb5" for a program using multiple APIs. From stephane@archlinux.org with changes. ticket: 6965 git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@25236 dc483132-0cff-0310-8789-dd5450dbe970 --- src/krb5-config.in | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/krb5-config.in b/src/krb5-config.in index 8435d02b0..b476b4fdd 100755 --- a/src/krb5-config.in +++ b/src/krb5-config.in @@ -186,7 +186,7 @@ if test -n "$do_libs"; then -e 's#\$(RPATH_FLAG)#'"$RPATH_FLAG"'#' \ -e 's#\$(LDFLAGS)#'"$LDFLAGS"'#' \ -e 's#\$(PTHREAD_CFLAGS)#'"$PTHREAD_CFLAGS"'#' \ - -e 's#\$(CFLAGS)#'"$CFLAGS"'#'` + -e 's#\$(CFLAGS)##'` if test $library = 'kdb'; then lib_flags="$lib_flags -lkdb5 $KDB5_DB_LIB" @@ -214,9 +214,13 @@ if test -n "$do_libs"; then fi if test $library = 'krb5'; then - lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err $GEN_LIB $LIBS $DL_LIB" + lib_flags="$lib_flags -lkrb5 -lk5crypto -lcom_err" fi + # If we ever support a flag to generate output suitable for static + # linking, we would output "-lkrb5support $GEN_LIB $LIBS $DL_LIB" + # here. + echo $lib_flags fi -- 2.26.2