Backport #7470
closedruby 1.9.3-p327 compile failure in siphash.c on Solaris because of endian.h
Description
I had previously built ruby 1.9.3-p194 on x86_64-sun-solaris2.10 with the no-cost Oracle WorkShop compilers:
$ cc -V
cc: Sun C 5.12 SunOS_i386 2011/11/16
However, when I attempt to build ruby-1.9.3-p327, I get a compilation failure in siphash.c, because it's including a header file (endian.h) that appears to be specific to Linux:
cc -m64 -Xa -xc99=all -xO0 -g -xs -xstrconst -mt -xtarget=native -xarch=native -I/local/include -I/local/gnu/include -I/local/openssl/include -m64 -DRUBY_EXPORT -I/local/include -I/local/gnu/include -I/local/openssl/include -I. -I.ext/include/x86_64-solaris2.10 -I./include -I. -o random.o -c random.c
"siphash.c", line 11: cannot find include file: <endian.h>
cc: acomp failed for random.c
gmake: *** [random.o] Error 2
Solaris doesn't include that header, instead it uses sys/byteorder.h.
The attached patch appears to fix the issue for me.
Files