#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
#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
# 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
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
--- /dev/null
+--- /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 */
#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>
#if HAVE_STDIO_H
#include <stdio.h>
#endif
+#if HAVE_STRING_H
+#include <string.h>
+#endif
#if HAVE_UNISTD_H
#include <unistd.h>
#endif