Enabling c99 (Enable ISO C99 features) didn't help:
CC=/opt/SUNWspro/bin/cc CFLAGS="-xc99=all" ./configure
make
...
"vm.c", line 3373: left operand must be modifiable lvalue: op "="
cc: acomp failed for vm.c
*** Error code 2
The following command caused the error:
/opt/SUNWspro/bin/cc -xc99=all -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600 -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
#
#make
BASERUBY = echo executable host ruby is required. use --with-baseruby option.;false CC = /usr/local/gcc4/bin/gcc
LD = /usr/ccs/bin/ld
LDSHARED = /usr/local/gcc4/bin/gcc -G
CFLAGS = -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH
XCFLAGS = -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS = -D_XOPEN_SOURCE=600
DLDFLAGS =
SOLIBS = -lz -lpthread -lrt -lrt -lrt -lsocket -ldl -lcrypt -lm
LANG =
LC_ALL =
LC_CTYPE =
MFLAGS =
gcc (GCC) 4.5.1
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software;see the source for copying conditions. There is NO
warranty;not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
compiling vm.c
In file included from /usr/include/stdio.h:21:0,
from ./include/ruby/defines.h:16,
from ./include/ruby/ruby.h:23,
from eval_intern.h:4,
from vm.c:13:
/usr/local/gcc4/lib/gcc/i386-pc-solaris2.10/4.5.1/include-fixed/sys/feature_tests.h:345:2: error: #error "Compiler or options invalid; UNIX 03 and POSIX.1-2001 applications require the use of c99"In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_push_frame':
vm_insnhelper.c:372:5: error: 'for' loop initial declarations are only allowed in C99 mode
vm_insnhelper.c:372:5: note: use option -std=c99 or -std=gnu99 to compile your code
vm_insnhelper.c: In function 'vm_search_cc':
vm_insnhelper.c:1652:17: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_callee_setup_arg':
vm_insnhelper.c:2438:13: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:352:0:
vm_insnhelper.c: In function 'vm_invoke_builtin_delegate':
vm_insnhelper.c:5598:9: error: 'for' loop initial declarations are only allowed in C99 mode
In file included from vm.c:358:0:
vm_method.c: In function 'vm_ccs_dump_i':
vm_method.c:32:5: error: 'for' loop initial declarations are only allowed in C99 mode
vm.c: In function 'env_copy':
vm.c:1008:9: error: 'for' loop initial declarations are only allowed in C99 mode
vm.c:1011:13: error: 'for' loop initial declarations are only allowed in C99 mode
*** Error code 1
The following command caused the error:
/usr/local/gcc4/bin/gcc -g -erroff=E_STATEMENT_NOT_REACHED -erroff=E_INIT_SIGN_EXTEND -erroff=E_INIT_DOES_NOT_FIT -erroff=E_INITIALIZATION_TYPE_MISMATCH -DRUBY_EXPORT -I. -I.ext/include/i386-solaris2.10 -I./include -I. -I./enc/unicode/12.1.0 -D_XOPEN_SOURCE=600 -o vm.o -c vm.c
make: Fatal error: Command failed for target `vm.o'
#