]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Compatibility fixes for Solaris/gcc
authorFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Aug 2010 13:15:48 +0000 (15:15 +0200)
committerFrancesco Chemolli <kinkie@squid-cache.org>
Mon, 23 Aug 2010 13:15:48 +0000 (15:15 +0200)
compat/compat.h
compat/os/solaris.h
configure.in
contrib/solaris/solaris-krb5-include.patch [new file with mode: 0644]
helpers/external_acl/kerberos_ldap_group/support.h
lib/rfc1035.c

index 0830219dfb55464924c90c093d63695557c2b509..e0bc1db9b1ae1f5f8801dace6378eeabe4cd71df 100644 (file)
 #include "compat/osdetect.h"
 
 /* ugly hack. But we need to set this REALLY soon in the header */
-#if _SQUID_SOLARIS_
+#if _SQUID_SOLARIS_ && !defined(__GNUC__) && !defined(__GNUG__)
+#ifndef __EXTENSIONS__
+#define __EXTENSIONS__ 1
+#endif
 #ifndef _XOPEN_SOURCE
 #define _XOPEN_SOURCE 1
 #endif
index 0e4e26b064ffbdfbb8f6625e78317e3918e03732..0a718d3bbe2b35cde56cb470d2042d9c3349dbcf 100644 (file)
 #endif /* wcsstr */
 #define wcsstr wcswcs
 
-/*
- * we need some standard-based extensions
- */
-#ifndef _XOPEN_SOURCE
-#define _XOPEN_SOURCE 1
-#endif
-#ifndef _XOPEN_SOURCE_EXTENDED
-#define _XOPEN_SOURCE_EXTENDED 1
-#endif
-
-
 /*
  * On Solaris 9 x86, gcc may includes a "fixed" set of old system
  * include files that is incompatible with the updated Solaris
index 78e203d9ed01927ce36c4793c8eb4fdd86ca07cf..61500805ef23491df090f5d46b2677429f519d29 100644 (file)
@@ -75,7 +75,9 @@ AC_SUBST(AR_R)
 
 # this needs to be before any test is run, to have more standard
 # functions available on some Unix sysems (e.g. Solaris)
-AC_USE_SYSTEM_EXTENSIONS
+if test "x$squid_host_os" = "solaris" -a "x$GCC" != "x" ; then
+       AC_USE_SYSTEM_EXTENSIONS
+fi
 
 AC_ARG_ENABLE(strict-error-checking,
   AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled
@@ -1717,12 +1719,16 @@ if test "x$ac_krb5_config" = "xyes" ; then
     AC_CHECK_HEADERS(gssapi/gssapi_generic.h)
     AC_CHECK_HEADERS(profile.h)
   fi
-  AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
 
   SQUID_CHECK_KRB5_SOLARIS_BROKEN_KRB5_H
   if test "x$squid_cv_broken_krb5_h" = "xyes"; then
-     AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++])
+    AC_DEFINE(HAVE_BROKEN_SOLARIS_KRB5_H, 1, [Define to 1 if krb5.h is broken for C++])
+    AC_MSG_WARN([You have a broken Solaris <krb5.h> system include.])
+    AC_MSG_WARN([Please see http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512])
+    AC_MSG_WARN([If you need Kerberos support you'll have to patch])
+    AC_MSG_WARN([your system. See contrib/solaris/solaris-krb5-include.patch])
   fi
+  AC_CHECK_HEADERS(krb5.h com_err.h et/com_err.h)
 
   ac_com_error_message=no
   if test "x$ac_cv_header_com_err_h" == "xyes" ; then
diff --git a/contrib/solaris/solaris-krb5-include.patch b/contrib/solaris/solaris-krb5-include.patch
new file mode 100644 (file)
index 0000000..0421ec6
--- /dev/null
@@ -0,0 +1,19 @@
+--- /usr/include/kerberosv5/krb5.h.orig        Mon Aug 23 04:09:23 2010
++++ /usr/include/kerberosv5/krb5.h     Mon Aug 23 04:10:53 2010
+@@ -171,6 +171,7 @@
+ #define KRB5INT_END_DECLS
+ #endif
+ #endif
++KRB5INT_BEGIN_DECLS
+ #if TARGET_OS_MAC 
+ #    pragma options align=mac68k 
+@@ -3246,8 +3247,4 @@
+ /* for compatibility with older versions... */
+ #define asn1_err_base ERROR_TABLE_BASE_asn1
+-#ifdef __cplusplus
+-}
+-#endif
+-
+ #endif                /* _KRB5_H */
index b6fd582ac60673de8681a790df3fb117b8139e97..996b7525267ae88ed99a2e645a7f149b8f542ec1 100644 (file)
 
 #define KERBEROS_LDAP_GROUP_VERSION "1.2.2sq"
 
-#ifdef HAVE_STRING_H
+#if HAVE_STRING_H
 #include <string.h>
 #endif
 
-#ifdef HAVE_HEIMDAL_KERBEROS
-#ifdef HAVE_GSSAPI_GSSAPI_H
+#if HAVE_HEIMDAL_KERBEROS
+#if HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
-#elif defined(HAVE_GSSAPI_H)
+#elif HAVE_GSSAPI_H
 #include <gssapi.h>
-#endif
-#ifdef HAVE_KRB5_H
+#endif /* HAVE_GSSAPI_GSSAPI_H/HAVE_GSSAPI_H */
+#if HAVE_KRB5_H
+#if HAVE_BROKEN_SOLARIS_KRB5_H
+#warn "Warning! You have a broken Solaris <krb5.h> fsystem header"
+#warn "http://bugs.opensolaris.org/bugdatabase/view_bug.do?bug_id=6837512"
+#endif /* HAVE_BROKEN_SOLARIS_KRB5_H */
 #include <krb5.h>
-#endif
-#ifdef HAVE_COM_ERR_H
+#endif /* HAVE_KRB5_H */
+#if HAVE_COM_ERR_H
 #include <com_err.h>
 #else
 #define error_message(code) krb5_get_err_text(kparam.context,code)
-#endif
+#endif /* HAVE_COM_ERR_H */
 #else /*MIT */
 #ifdef HAVE_GSSAPI_GSSAPI_H
 #include <gssapi/gssapi.h>
index 9f0df23bba470515cf85c18515749768d9adcb61..cc84fa49818feb0af4ff5c5a3ed107f716543b85 100644 (file)
@@ -44,6 +44,9 @@
 #if HAVE_STDIO_H
 #include <stdio.h>
 #endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
 #if HAVE_UNISTD_H
 #include <unistd.h>
 #endif