Skip to content

Instantly share code, notes, and snippets.

@yumitsu
Last active December 14, 2015 02:39
Show Gist options
  • Save yumitsu/5015331 to your computer and use it in GitHub Desktop.
Save yumitsu/5015331 to your computer and use it in GitHub Desktop.
Patch to compile ruby 1.9.3 with Clang on Mac OSX 10.8 (https://bugs.ruby-lang.org/issues/7830)
diff --git a/configure.in b/configure.in
index 732dd5d..8f5b364 100644
--- a/configure.in
+++ b/configure.in
@@ -172,6 +172,7 @@ RUBY_PROGRAM_VERSION=`sed -n 's/^#define RUBY_VERSION "\(.*\)"/\1/p' $srcdir/ver
AC_SUBST(RUBY_PROGRAM_VERSION)
RUBY_RELEASE_DATE=`sed -n 's/^#define RUBY_RELEASE_DATE "\(.*\)"/\1/p' $srcdir/version.h`
AC_SUBST(RUBY_RELEASE_DATE)
+RUBY_PATCHLEVEL=`sed -n 's/^#define RUBY_PATCHLEVEL //p' $srcdir/version.h`
AC_DEFINE(CANONICALIZATION_FOR_MATHN)
dnl checks for alternative programs
AC_CANONICAL_BUILD
@@ -615,9 +616,16 @@ AC_DEFUN(RUBY_TRY_LDFLAGS, [
save_LDFLAGS=
])
+AC_ARG_ENABLE(werror,
+ AS_HELP_STRING([--disable-werror],
+ [don't make warnings into errors even if a compiler support -Werror feature.]),
+ [particular_werror_flags=$enableval], [particular_werror_flags=])
+
rb_cv_warnflags="$warnflags"
if test "$GCC:${warnflags+set}:no" = yes::no; then
- particular_werror_flags=yes
+ if test -z "${particular_werror_flags}"; then
+ AS_CASE($RUBY_PATCHLEVEL, [-*], [particular_werror_flags=yes], [particular_werror_flags=no])
+ fi
for wflag in -Wno-unused-parameter -Wno-parentheses -Wno-long-long \
-Wno-missing-field-initializers \
-Wunused-variable \
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment