From: Amos Jeffries Date: Wed, 5 Mar 2014 12:08:54 +0000 (+1300) Subject: Better fix for CMSG definitions X-Git-Tag: SQUID_3_5_0_1~346 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ecd8516d19f1a3c4f5141fb6ce2daf446109a8b2;p=thirdparty%2Fsquid.git Better fix for CMSG definitions It turns out autoconf versions are not consistent with $ symbol escaping which can cause incorrect definitions. Revert to AC_CHECK_TYPE instead. Its a bit more verbose in configure.ac but works more often than not. --- diff --git a/acinclude/squid-util.m4 b/acinclude/squid-util.m4 index b82f696ed6..b41f67b6ef 100644 --- a/acinclude/squid-util.m4 +++ b/acinclude/squid-util.m4 @@ -248,23 +248,6 @@ AS_IF([test "$ac_res" != no], AS_VAR_POPDEF([ac_Search])dnl ]) -dnl checks that the system provides a given struct type -dnl defines HAVE_FOO if the type struct FOO exists. -AC_DEFUN([SQUID_CHECK_STRUCT],[ - squid_chk_struct="HAVE_$1" - AC_MSG_CHECKING([for struct $1]) - SQUID_TOUPPER_VAR_CONTENTS([squid_chk_struct]) - AC_COMPILE_IFELSE([ - AC_LANG_SOURCE([[$2]],[[struct $1 a;]]) - ],[ - AC_MSG_RESULT(yes) - AC_DEFINE_UNQUOTED([$squid_chk_struct],1,[Define to 1 if struct $1 is provided by the system]) - ],[ - AC_MSG_RESULT(no) - ]) - unset squid_chk_struct -]) - dnl Check for Cyrus SASL AC_DEFUN([SQUID_CHECK_SASL],[ squid_cv_check_sasl="auto" diff --git a/configure.ac b/configure.ac index 2d708d3ce9..34880eb48b 100644 --- a/configure.ac +++ b/configure.ac @@ -3131,7 +3131,7 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ AC_MSG_RESULT(no) ]) -SQUID_CHECK_STRUCT([cmsghdr],[ +AC_CHECK_TYPE(struct cmsghdr,AC_DEFINE(HAVE_CMSGHDR,1,[The system provides struct cmsghdr]),,[ #if HAVE_SYS_SOCKET_H #include #endif @@ -3140,7 +3140,7 @@ SQUID_CHECK_STRUCT([cmsghdr],[ #endif ]) -SQUID_CHECK_STRUCT([iovec],[ +AC_CHECK_TYPE(struct iovec,AC_DEFINE(HAVE_IOVEC,1,[The system provides struct iovec]),,[ #if HAVE_SYS_SOCKET_H #include #endif @@ -3149,7 +3149,7 @@ SQUID_CHECK_STRUCT([iovec],[ #endif ]) -SQUID_CHECK_STRUCT([msghdr],[ +AC_CHECK_TYPE(struct msghdr,AC_DEFINE(HAVE_MSGHDR,1,[The system provides struct msghdr]),,[ #if HAVE_SYS_SOCKET_H #include #endif @@ -3158,7 +3158,7 @@ SQUID_CHECK_STRUCT([msghdr],[ #endif ]) -SQUID_CHECK_STRUCT([sockaddr_un],[ +AC_CHECK_TYPE(struct sockaddr_un,AC_DEFINE(HAVE_SOCKADDR_UN,1,[The system provides sockaddr_un]),,[ #if HAVE_SYS_UN_H #include #endif