Compiling squid 3.2 with Sun CC

From: Jose-Marcio Martins da Cruz <Jose-Marcio.Martins_at_mines-paristech.fr>
Date: Fri, 16 Mar 2012 12:14:59 +0100

Hello,

Bad news...

The first attempt was to compile squid 3.2.0.16 with Sun CC, using the same options working with gcc
4.6.3.

configure goes till the end but...

launching gmake, the process stops with :

source='GnuRegex.c' object='GnuRegex.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../cfgaux/depcomp \
cc -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include -I../libltdl
-I/usr/local/ssl/include -errwarn=%all -errtags -D_REENTRANT -lpthread -Usparc -Uunix -Ui386
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g -c GnuRegex.c
"../compat/xstrto.h", line 24: warning: old-style declaration or incorrect type for: bool
(E_OLD_STYLE_DECL_OR_BAD_TYPE)
"../compat/xstrto.h", line 24: syntax error before or at: xstrtoul
"../compat/xstrto.h", line 25: warning: old-style declaration or incorrect type for: xstrtoul
(E_OLD_STYLE_DECL_OR_BAD_TYPE)
"../compat/xstrto.h", line 27: warning: old-style declaration or incorrect type for: bool
(E_OLD_STYLE_DECL_OR_BAD_TYPE)
"../compat/xstrto.h", line 27: syntax error before or at: xstrtoui
"../compat/xstrto.h", line 28: warning: old-style declaration or incorrect type for: xstrtoui
(E_OLD_STYLE_DECL_OR_BAD_TYPE)
cc: acomp failed for GnuRegex.c
gmake[1]: *** [GnuRegex.o] Error 2
gmake[1]: Leaving directory `/export/sources/squid/squid-3.2.0.16/compat'
gmake: *** [all-recursive] Error 1

This is because of the definition of "bool" return value of "xstrtoul" on xstrto.h.

********************************

config.log says this :

configure:24117: checking stdbool.h usability
configure:24117: CC -c -Usparc -Uunix -Ui386 -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -g
-I/usr/local/ssl/include conftest.cpp >
&5
"/usr/include/stdbool.h", line 42: Error: #error "Use of<stdbool.h> is valid only in a c99
compilation environment.".
configure:24117: $? = 1

*********************************
stdbool.h has the following :

#if defined(_STDC_C99)
   #undef bool
   #undef true
   #undef false
   #define bool _Bool
   #define true 1
   #define false 0
   #define __bool_true_false_are_defined 1
#else /* _STDC_C99 */
   #error "Use of <stdbool.h> is valid only in a c99 compilation environment."
#endif /* _STDC_C99 */

*************************************

So, to pass this, I tried to add "-xc99" option to CFLAGS and -xlang=c99 to CXXFLAGS (the one, the
other or both), but this doesn't solve the problem.

config log shows the same thing and gmake process ends with :

*************************************
source='GnuRegex.c' object='GnuRegex.o' libtool=no \
DEPDIR=.deps depmode=none /bin/bash ../cfgaux/depcomp \
cc -DHAVE_CONFIG_H -I.. -I../include -I../lib -I../src -I../include -I../libltdl
-I/usr/local/ssl/include -errwarn=%all -errtags -D_REENTRANT -lpthread -Usparc -Uunix -Ui386
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -xc99 -c GnuRegex.c
"/usr/include/sys/feature_tests.h", line 332: #error: "Compiler or options invalid for pre-UNIX 03
X/Open applications and pre-2001 POSIX applications"
cc: acomp failed for GnuRegex.c
gmake[1]: *** [GnuRegex.o] Error 2
gmake[1]: Leaving directory `/export/sources/squid/squid-3.2.0.16/compat'
gmake: *** [all-recursive] Error 1

**************************************

Sun CC is very pesky and I'm afraid it will be a hard work to get this working with Sun CC.

If you have any suggestions...

Regards

José-Marcio

-- 
  ---------------------------------------------------------------
  Jose Marcio MARTINS DA CRUZ           http://j-chkmail.ensmp.fr
  Ecole des Mines de Paris
  60, bd Saint Michel                      75272 - PARIS CEDEX 06
  mailto:Jose-Marcio.Martins_at_mines-paristech.fr
Received on Fri Mar 16 2012 - 11:15:03 MDT

This archive was generated by hypermail 2.2.0 : Fri Mar 16 2012 - 12:00:12 MDT