From: Francesco Chemolli Date: Tue, 28 May 2013 13:24:54 +0000 (+0200) Subject: Fix build on Intel's compiler suite. X-Git-Tag: SQUID_3_4_0_1~103 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=228332d342f5581cc9e3ab0c76778a7629ddd8af;p=thirdparty%2Fsquid.git Fix build on Intel's compiler suite. Forcing 64-bit file operations on 64-bit systems exposes an issue in stdlibc++, which is covered by gcc but not by icc in non-gcc mode. This patch prevents forcing 64-bit file operations on systems where long int is 64-bit or more. It also properly protects a couple of gcc-specific #pragma. --- diff --git a/configure.ac b/configure.ac index 3108ea7062..ff84540b1d 100644 --- a/configure.ac +++ b/configure.ac @@ -1583,6 +1583,9 @@ case "$withval" in esac ]) +#hack. Let's early-detect sizeof(long) +AC_CHECK_SIZEOF(long) + if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then for model in POSIX_V6_LPBIG_OFFBIG XBS5_LPBIG_OFFBIG POSIX_V6_LP64_OFF64 XBS5_LP64_OFF64 POSIX_V6_ILP32_OFFBIG XBS5_ILP32_OFFBIG; do if test "`getconf _$model 2>/dev/null || true`" = 1 || test "`getconf $model 2>/dev/null || true`" ; then @@ -1595,7 +1598,8 @@ if test "x$squid_opt_enable_large_files" = "xyes" -a "x$buildmodel" = "x"; then fi fi if test "x$buildmodel" = "xdefault" -o "x$buildmodel" = "x"; then - if test "x$squid_opt_enable_large_files" = "xyes" ; then + # define _FILE_OFFSET_BITS if requested and needed + if test "x$squid_opt_enable_large_files" = "xyes" -a $ac_cv_sizeof_long -le 4 ; then AC_MSG_NOTICE([Enabling -D_FILE_OFFSET_BITS=64]) CFLAGS="-D_FILE_OFFSET_BITS=64 $CFLAGS" CXXFLAGS="-D_FILE_OFFSET_BITS=64 $CXXFLAGS" diff --git a/tools/purge/convert.cc b/tools/purge/convert.cc index 64e8ec1415..4c636cae05 100644 --- a/tools/purge/convert.cc +++ b/tools/purge/convert.cc @@ -40,7 +40,7 @@ // Initial revision // // -#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) +#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) && !defined(__INTEL_COMPILER) #pragma implementation #endif diff --git a/tools/purge/socket.cc b/tools/purge/socket.cc index 2bd472cc14..3ef4102b01 100644 --- a/tools/purge/socket.cc +++ b/tools/purge/socket.cc @@ -42,7 +42,7 @@ // Initial revision // // -#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) +#if (defined(__GNUC__) || defined(__GNUG__)) && !defined(__clang__) && !defined(__INTEL_COMPILER) #pragma implementation #endif