Issue #7959 has been updated by jeremyevans0 (Jeremy Evans).


It appears this bug is still present in ruby 2.0.0-p195 and trunk. Bisecting v2_0_0_rc2 and trunk, the last revision that worked correctly is still 39288.  Can this bug please be reopened?  I'll be happy to test patches.

ruby 2.0.0-p195 on OpenBSD doesn't even build if you configure with /bin/sh and not with bash, due to issues with RUBY_EXEC_PREFIX:

cc -O2 -pipe -fPIC  -include ruby/config.h -include ruby/missing.h -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -DOPENSSL_NO_STATIC_ENGINE -I/usr/local/include   -I. -I.ext/include/i386-openbsd -I./include -I. -o ruby.o -c ruby.c
ruby.c: In function 'ruby_init_loadpath_safe':
ruby.c:495: error: expected expression before ';' token
*** Error 1 in /usr/obj/ports/ruby-2.0.0-p195/ruby-2.0.0-p195 (Makefile:326 'ruby.o')
----------------------------------------
Backport #7959: configure contains non-portable shell code
https://bugs.ruby-lang.org/issues/7959#change-39338

Author: jeremyevans0 (Jeremy Evans)
Status: Closed
Priority: Normal
Assignee: nagachika (Tomoyuki Chikanaga)
Category: 
Target version: 


On 2.0.0 and trunk, configure contains non-portable shell code.  When run on OpenBSD, configure emits the following errors and results in a ruby that builds but cannot run without manually specifying -I for the ruby lib directories:

...
checking for prefix of external symbols... NONE
checking for pthread.h... (cached) yes
checking if make is GNU make... no
checking for safe null command for make... :
checking for memmem... no
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g;s/ ...: invalid command code "
././configure: s/\\//g: not found
././configure: s/^\//;s/\$//": not found
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g;s/ ...: invalid command code "
././configure: s/\\//g: not found
././configure: s/^\//;s/\$//": not found
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g;s/ ...: invalid command code "
././configure: s/\\//g: not found
././configure: s/^\//;s/\$//": not found
sed: 1: ""s/${[^${}"]*}/"&"/g"": invalid command code "
sed: 1: ""s/${[^${}"]*}/"&"/g;s/ ...: invalid command code "
././configure: s/\\//g: not found
././configure: s/^\//;s/\$//": not found
checking for nroff... no
checking for awf... no
.ext/include/x86_64-openbsd/ruby/config.h updated
verconf.h updated
ruby library version = 2.0
configure: creating ./config.status
config.status: creating Makefile
config.status: creating ruby-2.0.pc

The last revision that worked correctly was 39288.

It's trivial to work around the issue by using "bash configure" instead of "./configure", but that shouldn't be necessary.  I'm sorry for not reporting this before the official release of 2.0.0, but this issue was introduced after rc2.


-- 
http://bugs.ruby-lang.org/