Project

General

Profile

Actions

Backport #8071

closed

Ruby 2.0 ./configure fails with syntax error on Illumos distributions

Added by psanford (Peter Sanford) about 11 years ago. Updated almost 11 years ago.


Description

Trying to build Ruby 2.0 on Illumos distributions, ./configure fails with the following syntax error:

./configure: line 2780: syntax error at line 19075: `(' unexpected

The problem code is in this function:

shvar_to_cpp() {
local var="$1" val="$2"
local exec_prefix_pat="echo \"${exec_prefix}\" | sed 's/\\./\\\\./g'"
local arch_pat="echo \"${arch}\" | sed 's/\\./\\\\./g'"
local sitearch_pat="echo \"${sitearch}\" | sed 's/\\./\\\\./g'"
val="echo '"'"${val}"'"' | sed \ -e 's/\${\([A-Z][A-Z_]*\)}/"\1"/g' \ -e 's|\${sitearchlibdir}|'"${sitearchlibdir}|g" \ -e 's|\${sitearchincludedir}|'"${sitearchincludedir}|g" \ -e 's|\${archlibdir}|'"${archlibdir}|g" \ -e 's|\${archincludedir}|'"${archincludedir}|g" \ -e 's|\${libdir}|'"${libdir}|g" \ -e 's/\${ruby_version}/"RUBY_LIB_VERSION"/g' \ -e 's/\${arch}/"arch"/g' \ -e 's/\${sitearch}/"arch"/g' \ -e 's/\${vendorarchdir}/"RUBY_VENDOR_ARCH_LIB"/g' \ -e 's/\${sitearchdir}/"RUBY_SITE_ARCH_LIB"/g' \ -e 's/\${vendorlibdir}/"RUBY_VENDOR_LIB2"/g' \ -e 's/\${sitelibdir}/"RUBY_SITE_LIB2"/g' \ -e 's/\${vendordir}/"RUBY_VENDOR_LIB"/g' \ -e 's/\${sitedir}/"RUBY_SITE_LIB"/g' \ -e 's/\${rubylibdir}/"RUBY_LIB"/g' \ -e 's/\${rubylibprefix}/"RUBY_LIB_PREFIX"/g' \ -e 's/\${rubyarchprefix}/"RUBY_ARCH_PREFIX_FOR(arch)"/g' \ -e 's/\${rubysitearchprefix}/"RUBY_SITEARCH_PREFIX_FOR(arch)"/g' \ -e 's/\${exec_prefix}/"RUBY_EXEC_PREFIX"/g' \ -e "s|${exec_prefix_pat}/|"'"RUBY_EXEC_PREFIX"/|g' \ -e "s|${arch_pat}|"'"arch"|g' \ -e "s|${sitearch_pat}|"'"sitearch"|g' \ -e 's|^\"NONE/|RUBY_EXEC_PREFIX\"/|' \ -e 's|^\"NONE\"|\"'"${prefix}"'\"|' \ -e 's/^\"\"\(.\)/\1/;s/\(.\)\"\"$/\1/' "
eval $var='"$val"'
}

Specifically these two lines:
-e 's/${rubyarchprefix}/"RUBY_ARCH_PREFIX_FOR(arch)"/g'
-e 's/${rubysitearchprefix}/"RUBY_SITEARCH_PREFIX_FOR(arch)"/g' \

I tested this on both SmartOS and OmniOS. On both of these distributions /bin/sh is ksh93.

I was able to work around this problem by using the GNU version of sh or bash instead of /bin/sh.


Related issues 2 (0 open2 closed)

Related to Backport200 - Backport #7959: configure contains non-portable shell codeRejectednagachika (Tomoyuki Chikanaga)Actions
Has duplicate Backport200 - Backport #8387: Compiling Ruby 2.0 on SunOSClosednagachika (Tomoyuki Chikanaga)05/10/2013Actions
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0