From: Amos Jeffries Date: Sun, 9 Aug 2009 07:31:39 +0000 (+1200) Subject: Detect broken libcap better X-Git-Tag: SQUID_3_2_0_1~804 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b43d20910e0beab3fe58d07ef3a9ae1348c970a;p=thirdparty%2Fsquid.git Detect broken libcap better libcap v1 is still common and broken. some libcap2 may also be. --- diff --git a/compat/os/linux.h b/compat/os/linux.h index 27ea415b14..21f6663b4b 100644 --- a/compat/os/linux.h +++ b/compat/os/linux.h @@ -30,13 +30,11 @@ /* * sys/capability.h is only needed in Linux apparently. * - * HACK: Ugly glue to get around linux header madness colliding with glibc - * NP: if you need to use the hack labeled MAYBE_DEAD please report to - * the developers. + * HACK: LIBCAP_BROKEN Ugly glue to get around linux header madness colliding with glibc */ #if HAVE_SYS_CAPABILITY_H -#if MAYBE_DEAD +#if LIBCAP_BROKEN #undef _POSIX_SOURCE #define _LINUX_TYPES_H #define _LINUX_FS_H diff --git a/configure.in b/configure.in index 2c13b60d0e..ade54a2148 100644 --- a/configure.in +++ b/configure.in @@ -2166,8 +2166,7 @@ AC_CHECK_HEADERS( \ inttypes.h \ grp.h \ db.h \ - db_185.h \ - sys/capability.h + db_185.h ) AC_CHECK_HEADERS( @@ -2434,6 +2433,17 @@ AC_CHECK_TYPE(socklen_t,AC_DEFINE(HAVE_SOCKLEN_T,1,[socklen_t is defined by the #include #endif]) +dnl Check for libcap1 breakage or libcap2 fixed +AC_CHECK_HEADERS(sys/capability.h) +libcap_broken=1 +AC_CACHE_CHECK([for operational libcap2], $libcap_broken, + AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[ + capget(NULL, NULL); + capset(NULL, NULL); + ]])],[libcap_broken=0],[]) +) +AC_DEFINE_UNQUOTED([LIBCAP_BROKEN],$libcap_broken,[if libcap2 is available and not clashing with libc]) + AC_CHECK_TYPE(mtyp_t,AC_DEFINE(HAVE_MTYP_T,1,[mtyp_t is defined by the system headers]),,[#include #include #include ])