Skip to content

Instantly share code, notes, and snippets.

@mattconnolly
Created November 18, 2012 08:45
Show Gist options
  • Save mattconnolly/4104287 to your computer and use it in GitHub Desktop.
Save mattconnolly/4104287 to your computer and use it in GitHub Desktop.
A patch for building ruby 1.9.3 in SmartOS / OpenIndiana
diff --git a/siphash.c b/siphash.c
index c100b14..589cdec 100644
--- a/siphash.c
+++ b/siphash.c
@@ -8,7 +8,11 @@
#ifdef _WIN32
#define BYTE_ORDER __LITTLE_ENDIAN
#elif !defined BYTE_ORDER
- #include <endian.h>
+ #if defined(sun)
+ #include <sys/isa_defs.h>
+ #else
+ #include <endian.h>
+ #endif
#endif
#ifndef LITTLE_ENDIAN
#define LITTLE_ENDIAN __LITTLE_ENDIAN
@mattconnolly
Copy link
Author

Save this patch file, eg to 'smartos.patch', then build ruby 1.9.3 in rvm like so:

$ rvm install 1.9.3 --patch smartos.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment