From: Francesco Chemolli Date: Tue, 10 Aug 2010 15:37:53 +0000 (+0200) Subject: Portability fix for OpenSolaris. X-Git-Tag: take1~400 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=cdb86165bc2d0fe25bca0d41733551b5645209a6;p=thirdparty%2Fsquid.git Portability fix for OpenSolaris. --- diff --git a/compat/compat.h b/compat/compat.h index 6f668775cd..0830219dfb 100644 --- a/compat/compat.h +++ b/compat/compat.h @@ -26,6 +26,17 @@ /******************************************************/ #include "compat/osdetect.h" +/* ugly hack. But we need to set this REALLY soon in the header */ +#if _SQUID_SOLARIS_ +#ifndef _XOPEN_SOURCE +#define _XOPEN_SOURCE 1 +#endif +#ifndef _XOPEN_SOURCE_EXTENDED +#define _XOPEN_SOURCE_EXTENDED 1 +#endif +#endif + + /*****************************************************/ /* FDSETSIZE is messy and needs to be done before */ diff --git a/compat/os/solaris.h b/compat/os/solaris.h index e90c0139f5..307e1c0fa1 100644 --- a/compat/os/solaris.h +++ b/compat/os/solaris.h @@ -8,6 +8,27 @@ #if _SQUID_SOLARIS_ + +/* + * ugly hack. System headers require wcsstr, but don't define it. + */ +#include +#ifdef wcsstr +#undef wcsstr +#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 diff --git a/configure.in b/configure.in index 410a9a7868..d78f975956 100644 --- a/configure.in +++ b/configure.in @@ -73,6 +73,10 @@ AC_PATH_PROG(AR, ar, $FALSE) AR_R="$AR r" 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 + AC_ARG_ENABLE(strict-error-checking, AS_HELP_STRING([--disable-strict-error-checking],[By default squid is compiled with all possible static compiler error-checks enabled. @@ -127,8 +131,6 @@ fi SQUID_CC_GUESS_VARIANT SQUID_CC_GUESS_OPTIONS - - dnl find out the exe extension for this platform. dnl If it is not empty, use it for CGI as well. AC_EXEEXT @@ -2151,7 +2153,8 @@ AC_CHECK_HEADERS( \ stdint.h \ inttypes.h \ db.h \ - db_185.h + db_185.h \ + wchar.h ) CHECK_STRUCT_PAM_CONV diff --git a/src/ip/Address.h b/src/ip/Address.h index 37c0717968..c42dfd4b5b 100644 --- a/src/ip/Address.h +++ b/src/ip/Address.h @@ -44,6 +44,9 @@ #if HAVE_NETINET_IN_H #include #endif +#if HAVE_NETINET_IP_H +#include +#endif #ifdef _SQUID_MSWIN_ #include #endif