1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-11-25 00:51:21 +00:00

Add DTRACE option

PR:		192614
Submitted by:	jbeich@
This commit is contained in:
Koop Mast 2015-01-30 10:04:27 +00:00
parent 8ba21f0052
commit 9d55d2cac8
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=378145
5 changed files with 103 additions and 2 deletions

View File

@ -27,13 +27,17 @@ WRKSRC= ${WRKDIR}/mozjs${PORTVERSION}/js/src
CONFIGURE_ARGS= --with-pthreads \
--with-system-nspr
OPTIONS_DEFINE= DEBUG GCZEAL JEMALLOC METHODJIT OPTIMIZE READLINE \
OPTIONS_DEFINE= DEBUG DTRACE GCZEAL JEMALLOC METHODJIT OPTIMIZE READLINE \
THREADSAFE TRACEJIT UTF8
OPTIONS_DEFAULT= METHODJIT OPTIMIZE READLINE THREADSAFE TRACEJIT
OPTIONS_SUB= yes
DEBUG_DESC= Enable Debug build
DEBUG_CONFIGURE_ENABLE= debug debug-symbols
DEBUG_CONFIGURE_DISABLE=debug
DTRACE_DESC= Build with DTrace probes # move to bsd.options.desc.mk
DTRACE_CONFIGURE_ENABLE=dtrace profiling
DTRACE_LIBS= -lelf
GCZEAL_DESC= Enable Zealous garbage collecting
GCZEAL_CONFIGURE_ENABLE=gczeal
JEMALLOC_DESC= Use jemalloc as memory allocator
@ -58,6 +62,13 @@ UTF8_CFLAGS= -DJS_C_STRINGS_ARE_UTF8
CONFIGURE_TARGET= x86_64-portbld-freebsd${OSREL}
.endif
.if ${PORT_OPTIONS:MDTRACE}
. if ${OSVERSION} < 1000510
BROKEN= dtrace -G crashes with C++ object files
. endif
STRIP_CMD= ${TRUE}
.endif
regression-test: build
@${ECHO_MSG} -n "===> Running jstests.py: "
@cd ${WRKSRC} && ${SETENV} TZ=PST8PDT ${PYTHON_CMD} tests/jstests.py \

View File

@ -0,0 +1,35 @@
diff --git js/src/config/rules.mk js/src/config/rules.mk
index 4d67eda..783942f 100644
--- config/rules.mk
+++ config/rules.mk
@@ -869,7 +869,7 @@ ifdef DTRACE_PROBE_OBJ
ifndef DTRACE_LIB_DEPENDENT
NON_DTRACE_OBJS := $(filter-out $(DTRACE_PROBE_OBJ),$(OBJS))
$(DTRACE_PROBE_OBJ): $(NON_DTRACE_OBJS)
- dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
+ dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(NON_DTRACE_OBJS)
endif
endif
endif
@@ -886,7 +886,7 @@ ifndef INCREMENTAL_LINKER
endif
ifdef DTRACE_LIB_DEPENDENT
ifndef XP_MACOSX
- dtrace -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
+ dtrace -x nolibs -G -C -s $(MOZILLA_DTRACE_SRC) -o $(DTRACE_PROBE_OBJ) $(shell $(EXPAND_LIBS) $(MOZILLA_PROBE_LIBS))
endif
$(EXPAND_MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(DTRACE_PROBE_OBJ) $(MOZILLA_PROBE_LIBS) $(RESFILE) $(LDFLAGS) $(WRAP_LDFLAGS) $(SHARED_LIBRARY_LIBS) $(EXTRA_DSO_LDOPTS) $(MOZ_GLUE_LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
@$(RM) $(DTRACE_PROBE_OBJ)
diff --git js/src/Makefile.in js/src/Makefile.in
index 28ca5e8..96793d7 100644
--- Makefile.in
+++ Makefile.in
@@ -906,7 +906,7 @@ endif
ifdef HAVE_DTRACE
$(CURDIR)/javascript-trace.h: $(srcdir)/javascript-trace.d
- dtrace -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
+ dtrace -x nolibs -h -s $(srcdir)/javascript-trace.d -o javascript-trace.h.in
sed -e 's/if _DTRACE_VERSION/ifdef INCLUDE_MOZILLA_DTRACE/' \
-e '/const/!s/char \*/const char */g' \
javascript-trace.h.in > javascript-trace.h

View File

@ -0,0 +1,32 @@
diff --git js/src/configure js/src/configure
index 59d69c7..779a50f 100644
--- configure
+++ configure
@@ -10204,7 +10204,13 @@ cross_compiling=$ac_cv_prog_cc_cross
# Check whether --enable-dtrace or --disable-dtrace was given.
if test "${enable_dtrace+set}" = set; then
enableval="$enable_dtrace"
- enable_dtrace="yes"
+ if test "$enableval" = "yes"; then
+ enable_dtrace="yes"
+ elif test "$enableval" = "no"; then
+ :
+ else
+ { echo "configure: error: Option, dtrace, does not take an argument ($enableval)." 1>&2; exit 1; }
+ fi
fi
if test "x$enable_dtrace" = "xyes"; then
diff --git js/src/configure.in js/src/configure.in
index 59d69c7..779a50f 100644
--- configure.in
+++ configure.in
@@ -2153,7 +2153,7 @@ dnl Quota support
MOZ_CHECK_HEADERS(sys/quota.h)
MOZ_CHECK_HEADERS(linux/quota.h)
-AC_ARG_ENABLE(dtrace,
+MOZ_ARG_ENABLE_BOOL(dtrace,
[ --enable-dtrace build with dtrace support if available (default=no)],
[enable_dtrace="yes"],)
if test "x$enable_dtrace" = "xyes"; then

View File

@ -0,0 +1,23 @@
diff --git js/src/Makefile.in js/src/Makefile.in
index e28160a..28ca5e8 100644
--- Makefile.in
+++ Makefile.in
@@ -57,7 +57,6 @@ ifdef JS_SHARED_LIBRARY
FORCE_SHARED_LIB = 1
endif
FORCE_STATIC_LIB = 1
-DIST_INSTALL = 1
VPATH = \
$(srcdir) \
@@ -857,8 +856,8 @@ install:: $(EXPORTS_mozilla)
install:: $(SCRIPTS)
$(SYSINSTALL) $^ $(DESTDIR)$(bindir)
-install:: $(REAL_LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
-ifneq (,$(REAL_LIBRARY))
+install:: $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
+ifdef DIST_INSTALL
$(SYSINSTALL) $(REAL_LIBRARY) $(DESTDIR)$(libdir)
mv -f $(DESTDIR)$(libdir)/$(REAL_LIBRARY) $(subst $(STATIC_LIBRARY_NAME),$(LIBRARY_NAME),$(DESTDIR)$(libdir)/$(REAL_LIBRARY))
endif

View File

@ -6,6 +6,7 @@ include/js-17.0/gc/Heap.h
include/js-17.0/gc/Root.h
include/js-17.0/gc/Statistics.h
include/js-17.0/gc/StoreBuffer.h
%%DTRACE%%include/js-17.0/javascript-trace.h
include/js-17.0/js-config.h
include/js-17.0/js.msg
include/js-17.0/js/HashTable.h
@ -62,7 +63,6 @@ include/js-17.0/mozilla/TypeTraits.h
include/js-17.0/mozilla/Types.h
include/js-17.0/mozilla/Util.h
include/js-17.0/mozilla/WeakPtr.h
lib/libmozjs-17.0.a
lib/libmozjs-17.0.so
lib/libmozjs-17.0.so.1
libdata/pkgconfig/mozjs-17.0.pc