Source: squid Version: 6.1-1 Tags: patch upstream User: debian-cr...@lists.debian.org Usertags: ftcbfs
squid fails to cross build from source, because it pessimistically uses AC_RUN_IFELSE, therefore concludes that kerberos is unavailable and then causes a compiler error due to an untested code path. I've reviewed the uses of AC_RUN_IFELSE and a number of them do not actually benefit from running code (while others do). I'm attaching a patch that converts some of the AC_RUN_IFELSE to AC_LINK_IFELSE and these happen to be enough to make squid cross buildable (though the cross build still turns of some features compared to a native build unless one provides more cache variables externally). What do you think about the attached conversion? Helmut
--- squid-6.6.orig/acinclude/krb5.m4 +++ squid-6.6/acinclude/krb5.m4 @@ -33,7 +33,7 @@ AC_CACHE_CHECK([for broken Heimdal krb5.h],squid_cv_broken_heimdal_krb5_h, [ SQUID_STATE_SAVE(squid_krb5_heimdal_test) CPPFLAGS="-I${srcdir:-.} $CPPFLAGS" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include <krb5.h> int main(void) @@ -45,7 +45,7 @@ return 0; } ]])], [ squid_cv_broken_heimdal_krb5_h=no ], [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_LINK_IFELSE([AC_LANG_SOURCE([[ #define HAVE_BROKEN_HEIMDAL_KRB5_H 1 #include "compat/krb5.h" int @@ -130,7 +130,7 @@ dnl checks that gssapi is ok, and sets squid_cv_working_gssapi accordingly AC_DEFUN([SQUID_CHECK_WORKING_GSSAPI], [ AC_CACHE_CHECK([for working gssapi], squid_cv_working_gssapi, [ - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_LINK_IFELSE([AC_LANG_SOURCE([[ #if USE_HEIMDAL_KRB5 #if HAVE_GSSAPI_GSSAPI_H #include <gssapi/gssapi.h> @@ -231,7 +231,7 @@ AC_CACHE_CHECK([for working krb5], squid_cv_working_krb5, [ SQUID_STATE_SAVE(squid_krb5_test) CPPFLAGS="-I${srcdir:-.} $CPPFLAGS" - AC_RUN_IFELSE([AC_LANG_SOURCE([[ + AC_LINK_IFELSE([AC_LANG_SOURCE([[ #include "compat/krb5.h" int main(void)