diff options
author | swills <swills@FreeBSD.org> | 2014-10-01 23:45:27 +0800 |
---|---|---|
committer | swills <swills@FreeBSD.org> | 2014-10-01 23:45:27 +0800 |
commit | e8df742801986ba2e0e0ce947a41a3bbe02c443d (patch) | |
tree | 76856ff2913b9dea93f1727c2a0f27071d8802f8 | |
parent | 6310959cb2a675a2ebbbf68b764b12521de1b308 (diff) | |
download | freebsd-ports-gnome-e8df742801986ba2e0e0ce947a41a3bbe02c443d.tar.gz freebsd-ports-gnome-e8df742801986ba2e0e0ce947a41a3bbe02c443d.tar.zst freebsd-ports-gnome-e8df742801986ba2e0e0ce947a41a3bbe02c443d.zip |
lang/ruby2*: fix dtrace support
DTrace support in ruby needs the -xnolibs flag added to the dtrace command
called during build to ensure that dtrace support is enabled even if the dtrace
kernel modules are not loaded at build time.
However, with this dtrace will be enabled on some OS versions where it will not
work, so add logic to disable it where appropriate.
-rw-r--r-- | Mk/bsd.ruby.mk | 4 | ||||
-rw-r--r-- | lang/ruby20/Makefile | 6 | ||||
-rw-r--r-- | lang/ruby20/files/patch-Makefile.in | 20 | ||||
-rw-r--r-- | lang/ruby20/files/patch-configure.in | 39 | ||||
-rw-r--r-- | lang/ruby21/Makefile | 6 | ||||
-rw-r--r-- | lang/ruby21/files/patch-Makefile.in | 20 | ||||
-rw-r--r-- | lang/ruby21/files/patch-configure.in | 41 |
7 files changed, 117 insertions, 19 deletions
diff --git a/Mk/bsd.ruby.mk b/Mk/bsd.ruby.mk index e3946d91628d..aff819951323 100644 --- a/Mk/bsd.ruby.mk +++ b/Mk/bsd.ruby.mk @@ -193,7 +193,7 @@ RUBY21= "@comment " # Ruby 2.0 # RUBY_RELVERSION= 2.0.0 -RUBY_PORTREVISION= 0 +RUBY_PORTREVISION= 1 RUBY_PORTEPOCH= 1 RUBY_PATCHLEVEL= 576 @@ -209,7 +209,7 @@ RUBY21= "@comment " # Ruby 2.1 # RUBY_RELVERSION= 2.1.3 -RUBY_PORTREVISION= 0 +RUBY_PORTREVISION= 1 RUBY_PORTEPOCH= 1 RUBY_PATCHLEVEL= 0 diff --git a/lang/ruby20/Makefile b/lang/ruby20/Makefile index 68269a190843..f0067f64a700 100644 --- a/lang/ruby20/Makefile +++ b/lang/ruby20/Makefile @@ -85,9 +85,13 @@ CPPFLAGS+= -I${LOCALBASE}/include # Keep this, else ruby will fail to load libraries dependent op libpthread. LIBS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} -.if ${ARCH} == "powerpc" +.if ${OPSYS} == "FreeBSD" +.if (${ARCH} == "i386" && ${OSVERSION} > 1010000) || (${ARCH} == "amd64" && ${OSVERSION} > 903000) +CONFIGURE_ARGS+= --enable-dtrace +.else CONFIGURE_ARGS+= --disable-dtrace .endif +.endif CONFIGURE_ENV= debugflags= diff --git a/lang/ruby20/files/patch-Makefile.in b/lang/ruby20/files/patch-Makefile.in new file mode 100644 index 000000000000..54e3167507ce --- /dev/null +++ b/lang/ruby20/files/patch-Makefile.in @@ -0,0 +1,20 @@ +--- Makefile.in.orig 2014-09-26 18:04:17.720164117 +0000 ++++ Makefile.in 2014-09-26 18:04:53.535161754 +0000 +@@ -342,7 +342,7 @@ + + .d.h: + @$(ECHO) translating probes $< +- $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $< ++ $(Q) $(DTRACE) -xnolibs -o $@.tmp -h -C $(INCFLAGS) -s $< + $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@ + $(Q) $(RM) $@.tmp + +@@ -362,7 +362,7 @@ + fi; \ + touch "$$stamp" + $(RM) $@ +- $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS) ++ $(Q) $(DTRACE) -xnolibs -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS) + + # DTrace static library hacks described here: + # http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html diff --git a/lang/ruby20/files/patch-configure.in b/lang/ruby20/files/patch-configure.in index 82b5aaf21ee6..7ccdb7f71888 100644 --- a/lang/ruby20/files/patch-configure.in +++ b/lang/ruby20/files/patch-configure.in @@ -1,6 +1,31 @@ ---- configure.in.orig 2014-01-30 15:58:25.000000000 +0000 -+++ configure.in 2014-07-26 19:30:21.165009183 +0000 -@@ -1401,11 +1401,11 @@ +--- configure.in.orig 2014-09-26 17:17:06.072358809 +0000 ++++ configure.in 2014-09-26 17:17:32.251357664 +0000 +@@ -515,7 +515,7 @@ + [AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available, + [ + echo "provider conftest{ probe fire(); };" > conftest_provider.d +- if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then ++ if $DTRACE -xnolibs -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then + # DTrace is available on the system + rb_cv_dtrace_available=yes + else +@@ -532,13 +532,13 @@ + [ + if { + echo "provider conftest{ probe fire(); };" > conftest_provider.d && +- dtrace -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && ++ dtrace -xnolibs -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && + cat >conftest.c <<_CONF && + @%:@include "conftest_provider.h" + int main(void){ CONFTEST_FIRE(); return 0; } + _CONF + $CC $CFLAGS -c -o conftest.o conftest.c && +- $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null ++ $DTRACE -xnolibs -G -s conftest_provider.d conftest.o 2>/dev/null + }; then + rb_cv_prog_dtrace_g=yes + else +@@ -1428,11 +1428,11 @@ AC_CHECK_DECLS([sys_nerr], [], [], [$ac_includes_default @%:@include <errno.h>]) @@ -17,7 +42,7 @@ AS_CASE(["$target_cpu"], [alpha*|sh4|sh4el|sh4eb], [AS_CASE(["$target_os"::"$GCC"], -@@ -2096,7 +2096,7 @@ +@@ -2123,7 +2123,7 @@ fi if test x"$enable_pthread" = xyes; then @@ -26,7 +51,7 @@ AC_CHECK_LIB($pthread_lib, pthread_kill, rb_with_pthread=yes, rb_with_pthread=no) if test "$rb_with_pthread" = "yes"; then break; fi -@@ -2110,6 +2110,7 @@ +@@ -2137,6 +2137,7 @@ [c], [], [root], [], [c_r], [MAINLIBS="-pthread $MAINLIBS"], @@ -34,7 +59,7 @@ [AS_CASE(["$target_os"], [openbsd*], [LIBS="-pthread $LIBS"], [LIBS="-l$pthread_lib $LIBS"])]) -@@ -2341,7 +2342,6 @@ +@@ -2368,7 +2369,6 @@ : ${LDSHARED='$(CC) -shared'} if test "$rb_cv_binary_elf" = yes; then LDFLAGS="$LDFLAGS -rdynamic" @@ -42,7 +67,7 @@ else test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable' fi -@@ -2728,6 +2728,7 @@ +@@ -2755,6 +2755,7 @@ [freebsd*|dragonfly*], [ SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' diff --git a/lang/ruby21/Makefile b/lang/ruby21/Makefile index 6696170acbc1..56dc3c677863 100644 --- a/lang/ruby21/Makefile +++ b/lang/ruby21/Makefile @@ -84,9 +84,13 @@ CPPFLAGS+= -I${LOCALBASE}/include # Keep this, else ruby will fail to load libraries dependent op libpthread. LIBS+= -L${LOCALBASE}/lib ${PTHREAD_LIBS} -.if ${ARCH} == "powerpc" +.if ${OPSYS} == "FreeBSD" +.if (${ARCH} == "i386" && ${OSVERSION} > 1010000) || (${ARCH} == "amd64" && ${OSVERSION} > 903000) +CONFIGURE_ARGS+= --enable-dtrace +.else CONFIGURE_ARGS+= --disable-dtrace .endif +.endif CONFIGURE_ENV= debugflags= diff --git a/lang/ruby21/files/patch-Makefile.in b/lang/ruby21/files/patch-Makefile.in new file mode 100644 index 000000000000..d82bd726b228 --- /dev/null +++ b/lang/ruby21/files/patch-Makefile.in @@ -0,0 +1,20 @@ +--- Makefile.in.orig 2014-10-01 13:48:32.240448887 +0000 ++++ Makefile.in 2014-10-01 13:49:42.263443819 +0000 +@@ -347,7 +347,7 @@ + + .d.h: + @$(ECHO) translating probes $< +- $(Q) $(DTRACE) -o $@.tmp -h -C $(INCFLAGS) -s $< ++ $(Q) $(DTRACE) -xnolibs -o $@.tmp -h -C $(INCFLAGS) -s $< + $(Q) sed -e 's/RUBY_/RUBY_DTRACE_/g' -e 's/PROBES_H_TMP/PROBES_H/g' -e 's/(char \*/(const char */g' -e 's/, char \*/, const char */g' $@.tmp > $@ + $(Q) $(RM) $@.tmp + +@@ -367,7 +367,7 @@ + fi; \ + touch "$$stamp" + $(RM) $@ +- $(Q) $(DTRACE) -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS) ++ $(Q) $(DTRACE) -xnolibs -G -C $(INCFLAGS) -s $(srcdir)/probes.d -o $@ $(DTRACE_DEPENDENT_OBJS) + + # DTrace static library hacks described here: + # http://mail.opensolaris.org/pipermail/dtrace-discuss/2005-August/000207.html diff --git a/lang/ruby21/files/patch-configure.in b/lang/ruby21/files/patch-configure.in index 3153a0629187..fffa001b8b7e 100644 --- a/lang/ruby21/files/patch-configure.in +++ b/lang/ruby21/files/patch-configure.in @@ -1,6 +1,31 @@ ---- configure.in.orig 2014-03-20 05:40:57.873422152 +0000 -+++ configure.in 2014-03-20 05:40:57.873422152 +0000 -@@ -1084,10 +1084,10 @@ +--- configure.in.orig 2014-10-01 13:46:05.488459511 +0000 ++++ configure.in 2014-10-01 13:45:56.345459984 +0000 +@@ -570,7 +570,7 @@ + [AC_CACHE_CHECK(whether dtrace USDT is available, rb_cv_dtrace_available, + [ + echo "provider conftest{ probe fire(); };" > conftest_provider.d +- if $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then ++ if $DTRACE -xnolibs -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null; then + # DTrace is available on the system + rb_cv_dtrace_available=yes + else +@@ -591,13 +591,13 @@ + probe fire(); + }; + _PROBES +- $DTRACE -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && ++ $DTRACE -xnolibs -h -o conftest_provider.h -s conftest_provider.d >/dev/null 2>/dev/null && + cat >conftest.c <<_CONF && + @%:@include "conftest_provider.h" + int main(void){ CONFTEST_FIRE(); return 0; } + _CONF + $CC $CFLAGS $CPPFLAGS -c -o conftest.o conftest.c && +- $DTRACE -G -s conftest_provider.d conftest.o 2>/dev/null ++ $DTRACE -xnolibs -G -s conftest_provider.d conftest.o 2>/dev/null + }; then + rb_cv_prog_dtrace_g=yes + else +@@ -1087,10 +1087,10 @@ ], [ LIBS="-lm $LIBS"]) @@ -15,7 +40,7 @@ dnl Checks for header files. AC_HEADER_DIRENT -@@ -1982,7 +1982,7 @@ +@@ -1998,7 +1998,7 @@ if test x"$ac_cv_func_clock_gettime" != xyes; then # glibc 2.17 moves clock_* functions from librt to the main C library. # http://sourceware.org/ml/libc-announce/2012/msg00001.html @@ -24,7 +49,7 @@ if test x"$ac_cv_lib_rt_clock_gettime" = xyes; then AC_DEFINE(HAVE_CLOCK_GETTIME, 1) fi -@@ -2423,7 +2423,7 @@ +@@ -2460,7 +2460,7 @@ fi if test x"$enable_pthread" = xyes; then @@ -33,7 +58,7 @@ AC_CHECK_LIB($pthread_lib, pthread_kill, rb_with_pthread=yes, rb_with_pthread=no) if test "$rb_with_pthread" = "yes"; then break; fi -@@ -2437,6 +2437,7 @@ +@@ -2474,6 +2474,7 @@ [c], [], [root], [], [c_r], [MAINLIBS="-pthread $MAINLIBS"], @@ -41,7 +66,7 @@ [AS_CASE(["$target_os"], [openbsd*|mirbsd*], [LIBS="-pthread $LIBS"], [LIBS="-l$pthread_lib $LIBS"])]) -@@ -2668,7 +2669,6 @@ +@@ -2735,7 +2736,6 @@ : ${LDSHARED='$(CC) -shared'} if test "$rb_cv_binary_elf" = yes; then LDFLAGS="$LDFLAGS -rdynamic" @@ -49,7 +74,7 @@ else test "$GCC" = yes && test "$rb_cv_prog_gnu_ld" = yes || LDSHARED='$(LD) -Bshareable' fi -@@ -3136,6 +3136,7 @@ +@@ -3203,6 +3203,7 @@ [freebsd*|dragonfly*], [ SOLIBS='$(LIBS)' LIBRUBY_SO='lib$(RUBY_SO_NAME).so.$(MAJOR)$(MINOR)' |