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 #1

Updated by kernigh (George Koehler) about 11 years ago

This bug looks almost like bug #7959 (configure problem with OpenBSD). This bug might not be exactly the same, so I don't know if the fix for bug #7959 would also fix this bug.

Updated by luislavena (Luis Lavena) about 11 years ago

  • Category set to build
  • Status changed from Open to Assigned
  • Assignee set to nobu (Nobuyoshi Nakada)

=begin
RubyInstaller CI seems to be suffering something related to this too:

http://ci.rubyinstaller.org/job/ruby-2_0_0-x64-build/35/console

../configure: line 19620: syntax error near unexpected token [_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\' ../configure: line 19620: s/^\([$as_cr_alnum]*cv[$as_cr_alnum]\)=\(.\)/\1='\2'/p"'
=end

Actions #3

Updated by nobu (Nobuyoshi Nakada) about 11 years ago

  • Status changed from Assigned to Closed
  • % Done changed from 0 to 100

This issue was solved with changeset r39741.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


configure.in: fix for old shells

  • configure.in (rm, shvar_to_cpp, unexpand_shvar): local is not
    available on old shells.
  • configure.in (shvar_to_cpp): escape quotes for old shells.
    [Bug #7959] [Bug #8071]
Actions #4

Updated by nobu (Nobuyoshi Nakada) almost 11 years ago

  • Tracker changed from Bug to Backport
  • Project changed from Ruby master to Backport200
  • Category deleted (build)
  • Status changed from Closed to Assigned
  • Assignee changed from nobu (Nobuyoshi Nakada) to nagachika (Tomoyuki Chikanaga)
Actions #5

Updated by nagachika (Tomoyuki Chikanaga) almost 11 years ago

  • Status changed from Assigned to Closed

This issue was solved with changeset r40647.
Peter, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.


merge revision(s) 39636,39741,40454: [Backport #8071] [Backport #8387]

configure.in: suppress error messages

* configure.in: suppress error messages, rm: cannot remove

'conftest.dSYM', from AC_EGREP_CPP with CFLAGS=-g on Darwin.
* configure.in (rm, shvar_to_cpp, unexpand_shvar): local is not
available on old shells.

* configure.in (shvar_to_cpp): escape quotes for old shells.
  [Bug #7959] [Bug #8071]

* configure.in (RUBY_RM_RECURSIVE): this hack is needed by only
  autoconf 2.69 or earlier on darwin.
Actions

Also available in: Atom PDF

Like0
Like0Like0Like0Like0Like0