1 diff -aur ruby-1.8.5.orig/Makefile.in ruby-1.8.5/Makefile.in
2 --- ruby-1.8.5.orig/Makefile.in 2006-08-08 04:37:43.000000000 +0200
3 +++ ruby-1.8.5/Makefile.in 2006-08-25 16:44:19.273278750 +0200
7 OUTFLAG = @OUTFLAG@$(empty)
8 -CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@
9 +CFLAGS = @CFLAGS@ @XCFLAGS@ @ARCH_FLAG@ @VALGRIND_CFLAGS@
10 CPPFLAGS = -I. -I$(srcdir) @CPPFLAGS@
11 LDFLAGS = @STATIC@ $(CFLAGS) @LDFLAGS@
13 diff -aur ruby-1.8.5.orig/configure ruby-1.8.5/configure
14 --- ruby-1.8.5.orig/configure 2006-08-25 10:34:16.000000000 +0200
15 +++ ruby-1.8.5/configure 2006-08-25 16:44:19.281279250 +0200
37 # Initialize some variables set by options.
40 libdir='${exec_prefix}/lib'
41 localedir='${datarootdir}/locale'
42 -mandir='${datarootdir}/man'
43 +mandir='${prefix}/man'
48 --datadir=DIR read-only architecture-independent data [DATAROOTDIR]
49 --infodir=DIR info documentation [DATAROOTDIR/info]
50 --localedir=DIR locale-dependent data [DATAROOTDIR/locale]
51 - --mandir=DIR man documentation [DATAROOTDIR/man]
52 + --mandir=DIR man documentation [PREFIX/man]
53 --docdir=DIR documentation root [DATAROOTDIR/doc/PACKAGE]
54 --htmldir=DIR html documentation [DOCDIR]
55 --dvidir=DIR dvi documentation [DOCDIR]
57 --disable-largefile omit support for large files
58 --enable-pthread use pthread library.
59 --enable-setreuid use setreuid()/setregid() according to need even if obsolete.
60 + --enable-valgrind use valgrind support.
61 --disable-rpath embed run path into extension libraries.
62 --enable-shared build a shared library for Ruby.
63 --enable-install-doc build and install rdoc indexes during install
64 @@ -1370,6 +1377,11 @@
65 YFLAGS The list of arguments that will be passed by default to $YACC.
66 This script will default YFLAGS to the empty string to avoid a
67 default value of `-d' given by some make applications.
68 + PKG_CONFIG path to pkg-config utility
70 + C compiler flags for VALGRIND, overriding pkg-config
72 + linker flags for VALGRIND, overriding pkg-config
74 Use these variables to override the choices made by `configure' or to help
75 it to find libraries and programs with nonstandard names/locations.
76 @@ -17964,6 +17976,217 @@
80 +# Check whether --enable-valgrind was given.
81 +if test "${enable_valgrind+set}" = set; then
82 + enableval=$enable_valgrind; want_valgrind=$enableval
88 +if test x"$want_valgrind" != xno; then
91 +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
92 + if test -n "$ac_tool_prefix"; then
93 + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args.
94 +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2
95 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
96 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
97 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then
98 + echo $ECHO_N "(cached) $ECHO_C" >&6
100 + case $PKG_CONFIG in
102 + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
105 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
109 + test -z "$as_dir" && as_dir=.
110 + for ac_exec_ext in '' $ac_executable_extensions; do
111 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
112 + ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
113 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
123 +PKG_CONFIG=$ac_cv_path_PKG_CONFIG
124 +if test -n "$PKG_CONFIG"; then
125 + { echo "$as_me:$LINENO: result: $PKG_CONFIG" >&5
126 +echo "${ECHO_T}$PKG_CONFIG" >&6; }
128 + { echo "$as_me:$LINENO: result: no" >&5
129 +echo "${ECHO_T}no" >&6; }
134 +if test -z "$ac_cv_path_PKG_CONFIG"; then
135 + ac_pt_PKG_CONFIG=$PKG_CONFIG
136 + # Extract the first word of "pkg-config", so it can be a program name with args.
137 +set dummy pkg-config; ac_word=$2
138 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5
139 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; }
140 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then
141 + echo $ECHO_N "(cached) $ECHO_C" >&6
143 + case $ac_pt_PKG_CONFIG in
145 + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path.
148 + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
152 + test -z "$as_dir" && as_dir=.
153 + for ac_exec_ext in '' $ac_executable_extensions; do
154 + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; }; then
155 + ac_cv_path_ac_pt_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
156 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
166 +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG
167 +if test -n "$ac_pt_PKG_CONFIG"; then
168 + { echo "$as_me:$LINENO: result: $ac_pt_PKG_CONFIG" >&5
169 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6; }
171 + { echo "$as_me:$LINENO: result: no" >&5
172 +echo "${ECHO_T}no" >&6; }
175 + if test "x$ac_pt_PKG_CONFIG" = x; then
178 + case $cross_compiling:$ac_tool_warned in
180 +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
181 +whose name does not start with the host triplet. If you think this
182 +configuration is useful to you, please write to autoconf@gnu.org." >&5
183 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
184 +whose name does not start with the host triplet. If you think this
185 +configuration is useful to you, please write to autoconf@gnu.org." >&2;}
186 +ac_tool_warned=yes ;;
188 + PKG_CONFIG=$ac_pt_PKG_CONFIG
191 + PKG_CONFIG="$ac_cv_path_PKG_CONFIG"
195 +if test -n "$PKG_CONFIG"; then
196 + _pkg_min_version=0.9.0
197 + { echo "$as_me:$LINENO: checking pkg-config is at least version $_pkg_min_version" >&5
198 +echo $ECHO_N "checking pkg-config is at least version $_pkg_min_version... $ECHO_C" >&6; }
199 + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
200 + { echo "$as_me:$LINENO: result: yes" >&5
201 +echo "${ECHO_T}yes" >&6; }
203 + { echo "$as_me:$LINENO: result: no" >&5
204 +echo "${ECHO_T}no" >&6; }
211 +{ echo "$as_me:$LINENO: checking for VALGRIND" >&5
212 +echo $ECHO_N "checking for VALGRIND... $ECHO_C" >&6; }
214 +if test -n "$PKG_CONFIG"; then
215 + if test -n "$VALGRIND_CFLAGS"; then
216 + pkg_cv_VALGRIND_CFLAGS="$VALGRIND_CFLAGS"
218 + if test -n "$PKG_CONFIG" && \
219 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"valgrind\"") >&5
220 + ($PKG_CONFIG --exists --print-errors "valgrind") 2>&5
222 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
223 + (exit $ac_status); }; then
224 + pkg_cv_VALGRIND_CFLAGS=`$PKG_CONFIG --cflags "valgrind" 2>/dev/null`
232 +if test -n "$PKG_CONFIG"; then
233 + if test -n "$VALGRIND_LIBS"; then
234 + pkg_cv_VALGRIND_LIBS="$VALGRIND_LIBS"
236 + if test -n "$PKG_CONFIG" && \
237 + { (echo "$as_me:$LINENO: \$PKG_CONFIG --exists --print-errors \"valgrind\"") >&5
238 + ($PKG_CONFIG --exists --print-errors "valgrind") 2>&5
240 + echo "$as_me:$LINENO: \$? = $ac_status" >&5
241 + (exit $ac_status); }; then
242 + pkg_cv_VALGRIND_LIBS=`$PKG_CONFIG --libs "valgrind" 2>/dev/null`
253 +if test $pkg_failed = yes; then
255 +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
256 + _pkg_short_errors_supported=yes
258 + _pkg_short_errors_supported=no
260 + if test $_pkg_short_errors_supported = yes; then
261 + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "valgrind"`
263 + VALGRIND_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "valgrind"`
265 + # Put the nasty error message in config.log where it belongs
266 + echo "$VALGRIND_PKG_ERRORS" >&5
269 +elif test $pkg_failed = untried; then
272 + VALGRIND_CFLAGS=$pkg_cv_VALGRIND_CFLAGS
273 + VALGRIND_LIBS=$pkg_cv_VALGRIND_LIBS
274 + { echo "$as_me:$LINENO: result: yes" >&5
275 +echo "${ECHO_T}yes" >&6; }
279 + if test x"$have_valgrind" = xyes; then
280 + cat >>confdefs.h <<\_ACEOF
281 +#define HAVE_VALGRIND 1
284 + elif test x"$want_valgrind" = xyes -a x"$have_valgrind" = xno; then
285 + { { echo "$as_me:$LINENO: error: valgrind support requested but valgrind not found" >&5
286 +echo "$as_me: error: valgrind support requested but valgrind not found" >&2;}
287 + { (exit 1); exit 1; }; }
291 DEFAULT_KCODE="KCODE_NONE"
294 @@ -20080,6 +20303,9 @@
295 MAKEDIRS!$MAKEDIRS$ac_delim
296 LIBOBJS!$LIBOBJS$ac_delim
297 ALLOCA!$ALLOCA$ac_delim
298 +PKG_CONFIG!$PKG_CONFIG$ac_delim
299 +VALGRIND_CFLAGS!$VALGRIND_CFLAGS$ac_delim
300 +VALGRIND_LIBS!$VALGRIND_LIBS$ac_delim
301 DLDFLAGS!$DLDFLAGS$ac_delim
302 ARCH_FLAG!$ARCH_FLAG$ac_delim
303 STATIC!$STATIC$ac_delim
304 @@ -20089,9 +20315,6 @@
305 DLEXT2!$DLEXT2$ac_delim
306 LIBEXT!$LIBEXT$ac_delim
307 LINK_SO!$LINK_SO$ac_delim
308 -LIBPATHFLAG!$LIBPATHFLAG$ac_delim
309 -RPATHFLAG!$RPATHFLAG$ac_delim
310 -LIBPATHENV!$LIBPATHENV$ac_delim
313 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then
314 @@ -20133,6 +20356,9 @@
316 for ac_last_try in false false false false false :; do
317 cat >conf$$subs.sed <<_ACEOF
318 +LIBPATHFLAG!$LIBPATHFLAG$ac_delim
319 +RPATHFLAG!$RPATHFLAG$ac_delim
320 +LIBPATHENV!$LIBPATHENV$ac_delim
321 TRY_LINK!$TRY_LINK$ac_delim
322 STRIP!$STRIP$ac_delim
323 EXTSTATIC!$EXTSTATIC$ac_delim
324 @@ -20178,7 +20404,7 @@
325 LTLIBOBJS!$LTLIBOBJS$ac_delim
328 - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 43; then
329 + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 46; then
331 elif $ac_last_try; then
332 { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
333 diff -aur ruby-1.8.5.orig/configure.in ruby-1.8.5/configure.in
334 --- ruby-1.8.5.orig/configure.in 2006-08-08 04:37:43.000000000 +0200
335 +++ ruby-1.8.5/configure.in 2006-08-25 16:44:19.281279250 +0200
340 +AC_ARG_ENABLE(valgrind,
341 + [ --enable-valgrind use valgrind support.],
342 + [want_valgrind=$enableval], [want_valgrind=auto])
344 +if test x"$want_valgrind" != xno; then
345 + PKG_CHECK_MODULES(VALGRIND, valgrind, have_valgrind=yes, have_valgrind=no)
347 + if test x"$have_valgrind" = xyes; then
348 + AC_DEFINE(HAVE_VALGRIND)
349 + elif test x"$want_valgrind" = xyes -a x"$have_valgrind" = xno; then
350 + AC_MSG_ERROR(valgrind support requested but valgrind not found)
354 dnl default value for $KANJI
355 DEFAULT_KCODE="KCODE_NONE"
357 diff -aur ruby-1.8.5.orig/gc.c ruby-1.8.5/gc.c
358 --- ruby-1.8.5.orig/gc.c 2006-08-25 10:12:46.000000000 +0200
359 +++ ruby-1.8.5/gc.c 2006-08-25 16:44:19.285279500 +0200
361 #include <sys/resource.h>
364 +#ifdef HAVE_VALGRIND
365 +#include <memcheck.h>
367 +#define VALGRIND_MAKE_MEM_DEFINED(p, n) /* empty */
371 #include <ucontext.h>
372 #if defined(__FreeBSD__)
378 + VALGRIND_MAKE_MEM_DEFINED(x, sizeof(*x) * n);
382 if (is_pointer_to_heap((void *)v)) {
385 register RVALUE *obj;
387 + VALGRIND_MAKE_MEM_DEFINED(&ptr, sizeof(ptr));
389 + VALGRIND_MAKE_MEM_DEFINED(obj, sizeof(*obj));
391 if (rb_special_const_p(ptr)) return; /* special const not marked */
392 if (obj->as.basic.flags == 0) return; /* free cell */
393 if (obj->as.basic.flags & FL_MARK) return; /* already marked */