Issue #11733 has been updated by Tomoyuki Chikanaga.

Backport changed from 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: REQUIRED to 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE

Backported into `ruby_2_2` branch at r52973.

----------------------------------------
Bug #11733: Compile of ruby 2.2.3 fails on AIX 6.1 TL07 SP03
https://bugs.ruby-lang.org/issues/11733#change-55361

* Author: Perry Smith
* Status: Closed
* Priority: Normal
* Assignee: cruby-aix
* ruby -v: 
* Backport: 2.0.0: DONTNEED, 2.1: DONTNEED, 2.2: DONE
----------------------------------------
The build on AIX fails in the ext/-test-/file directory with errors such as

compiling /usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c: In function 'get_fsname':
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:39:14: error: storage size of 'st' isn't known
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:44:5: warning: implicit declaration of function 'statvfs'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:39:14: warning: unused variable 'st'
make: *** [fs.o] Error 1

This can be avoided if line 65 is modified but then we encounter a second error:

compiling /usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c: In function 'get_fsname':
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:45:5: warning: implicit declaration of function 'statvfs'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:49:11: error: 'struct statfs' has no member named 'f_basetype'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:50:9: error: 'struct statfs' has no member named 'f_basetype'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:50:9: error: 'struct statfs' has no member named 'f_basetype'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:50:9: error: 'struct statfs' has no member named 'f_basetype'
/usr/work/src/ruby-2.2.3/ext/-test-/file/fs.c:50:9: error: 'struct statfs' has no member named 'f_basetype'

In the extconf.rb, they test for struct statfs -- which AIX has but the code declares variables of statfs_t which AIX does not have.

The AIX statfs is defined in /usr/include/sys/statfs.h (which is included by vfs.h).  It has an f_type field but not an f_basetype field.

To get around the issue, I kludged extconf.rb to fail to find the structures it was looking for and then it built but this is clearly not a real solution.




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