]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Better fix for CMSG definitions
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 5 Mar 2014 12:08:54 +0000 (01:08 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 5 Mar 2014 12:08:54 +0000 (01:08 +1300)
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.

acinclude/squid-util.m4
configure.ac

index b82f696ed68b74c93a7dd1be2f1d6afb86facb5e..b41f67b6ef491a566c7266b97aa12acaa54a6f9d 100644 (file)
@@ -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"
index 2d708d3ce96b1fdb3c85109cb3c7c5f83585ab32..34880eb48b8956416e728c721ad05df60b4dbcac 100644 (file)
@@ -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 <sys/socket.h>
   #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 <sys/socket.h>
   #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 <sys/socket.h>
   #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 <sys/un.h>
   #endif