Skip to content

Commit

Permalink
Add support for the dtrace option.
Browse files Browse the repository at this point in the history
  • Loading branch information
jperkin committed May 23, 2017
1 parent c74019f commit 93e60bf
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 9 deletions.
3 changes: 2 additions & 1 deletion lang/python36/PLIST
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.4 2017/03/30 11:42:58 adam Exp $
@comment $NetBSD: PLIST,v 1.5 2017/05/23 10:53:56 jperkin Exp $
bin/2to3-${PY_VER_SUFFIX}
bin/pydoc${PY_VER_SUFFIX}
bin/python${PY_VER_SUFFIX}
Expand Down Expand Up @@ -71,6 +71,7 @@ include/python${PY_VER_SUFFIX}/pyconfig.h
include/python${PY_VER_SUFFIX}/pyctype.h
include/python${PY_VER_SUFFIX}/pydebug.h
include/python${PY_VER_SUFFIX}/pydtrace.h
${PLIST.dtrace}include/python${PY_VER_SUFFIX}/pydtrace_probes.h
include/python${PY_VER_SUFFIX}/pyerrors.h
include/python${PY_VER_SUFFIX}/pyexpat.h
include/python${PY_VER_SUFFIX}/pyfpe.h
Expand Down
6 changes: 3 additions & 3 deletions lang/python36/distinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: distinfo,v 1.8 2017/03/30 11:42:58 adam Exp $
$NetBSD: distinfo,v 1.9 2017/05/23 10:53:56 jperkin Exp $

SHA1 (Python-3.6.1.tar.xz) = 91d880a2a9fcfc6753cbfa132bf47a47e17e7b16
RMD160 (Python-3.6.1.tar.xz) = 77e70ec6a07b9c17a99ac1df503f12f3a4c49fce
Expand All @@ -9,10 +9,10 @@ SHA1 (patch-Lib_distutils_command_install.py) = 6fc6f5d918b7581fc62cd0fe55857ee9
SHA1 (patch-Lib_distutils_sysconfig.py) = 6822eafb4dfded86d7f7353831816aeb8119e6cf
SHA1 (patch-Lib_distutils_unixccompiler.py) = e7aa684fa186de7a01486c3d8bfa177afdd22ef9
SHA1 (patch-Lib_sysconfig.py) = a4f009ed73ebbd9d9c4bf7e12b7981182ed8fd7c
SHA1 (patch-Makefile.pre.in) = 99b33ba203eb2c9c626377f1bac03c723d467553
SHA1 (patch-Makefile.pre.in) = cb93d2cbb9e395a92d144ec45ede91bea744dca9
SHA1 (patch-Modules___cursesmodule.c) = 2ab2779e0418a4529987641c254686ba05d28593
SHA1 (patch-Modules_makesetup) = a06786eebffadecedba5e3a50a9785fb47613567
SHA1 (patch-Modules_nismodule.c) = 1bafe9b06359586d027a77011b103877590d947d
SHA1 (patch-Python_thread__pthread.h) = fb81eaa604b4ed7c1b64c3f4731d58a8aee257be
SHA1 (patch-configure) = b0ed2f58d1b554aa8d81ffdabaae39f3109811d0
SHA1 (patch-configure) = fe9b0213b64313dab4c453a8bd7135db961f6ac4
SHA1 (patch-setup.py) = 1e14b84fc5cb21b3fa61755bf574021ba9b2ab81
10 changes: 8 additions & 2 deletions lang/python36/options.mk
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
# $NetBSD: options.mk,v 1.1 2017/01/01 14:34:27 adam Exp $
# $NetBSD: options.mk,v 1.2 2017/05/23 10:53:56 jperkin Exp $

PKG_OPTIONS_VAR= PKG_OPTIONS.python36
PKG_SUPPORTED_OPTIONS+= x11
PKG_SUPPORTED_OPTIONS= dtrace x11
PKG_SUGGESTED_OPTIONS= x11

.include "../../mk/bsd.prefs.mk"
.include "../../mk/bsd.options.mk"

PLIST_VARS+= dtrace
.if !empty(PKG_OPTIONS:Mdtrace)
CONFIGURE_ARGS+= --with-dtrace
PLIST.dtrace= yes
.endif

.if !empty(PKG_OPTIONS:Mx11)
# Support for native X11 paths as an option
# This code is no-op for modular X11, however for simplicity don't make it conditional.
Expand Down
29 changes: 27 additions & 2 deletions lang/python36/patches/patch-Makefile.pre.in
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
$NetBSD: patch-Makefile.pre.in,v 1.1 2017/01/01 14:34:27 adam Exp $
$NetBSD: patch-Makefile.pre.in,v 1.2 2017/05/23 10:53:56 jperkin Exp $

Use only one optimisation level; needed for PLIST and setuptools compatibility.

Simplify _sysconfigdata to include only platform name.

--- Makefile.pre.in.orig 2016-12-23 02:21:21.000000000 +0000
--- Makefile.pre.in.orig 2017-03-21 06:32:38.000000000 +0000
+++ Makefile.pre.in
@@ -96,7 +96,7 @@ PY_CFLAGS_NODIST=$(CONFIGURE_CFLAGS_NODI
# be able to build extension modules using the directories specified in the
Expand All @@ -15,6 +15,15 @@ Simplify _sysconfigdata to include only platform name.
NO_AS_NEEDED= @NO_AS_NEEDED@
LDLAST= @LDLAST@
SGI_ABI= @SGI_ABI@
@@ -463,7 +463,7 @@ LIBRARY_OBJS= \
# On some systems, object files that reference DTrace probes need to be modified
# in-place by dtrace(1).
DTRACE_DEPS = \
- Python/ceval.o
+ Python/ceval.o Modules/gcmodule.o
# XXX: should gcmodule, etc. be here, too?

#########################################################################
@@ -871,7 +871,6 @@ Objects/setobject.o: $(srcdir)/Objects/s
$(OPCODETARGETS_H): $(OPCODETARGETGEN_FILES)
$(PYTHON_FOR_GEN) $(OPCODETARGETGEN) $(OPCODETARGETS_H)
Expand All @@ -23,6 +32,22 @@ Simplify _sysconfigdata to include only platform name.

Python/frozen.o: Python/importlib.h Python/importlib_external.h

@@ -879,13 +878,13 @@ Python/frozen.o: Python/importlib.h Pyth
# follow our naming conventions. dtrace(1) uses the output filename to generate
# an include guard, so we can't use a pipeline to transform its output.
Include/pydtrace_probes.h: $(srcdir)/Include/pydtrace.d
- $(DTRACE) $(DFLAGS) -o $@ -h -s $<
+ $(DTRACE) $(DFLAGS) -o $@ -h -s $(srcdir)/Include/pydtrace.d
: sed in-place edit with POSIX-only tools
sed 's/PYTHON_/PyDTrace_/' $@ > [email protected]
mv [email protected] $@

Python/pydtrace.o: $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)
- $(DTRACE) $(DFLAGS) -o $@ -G -s $< $(DTRACE_DEPS)
+ $(DTRACE) $(DFLAGS) -o $@ -G -s $(srcdir)/Include/pydtrace.d $(DTRACE_DEPS)

Objects/typeobject.o: Objects/typeslots.inc
Objects/typeslots.inc: $(srcdir)/Include/typeslots.h $(srcdir)/Objects/typeslots.py
@@ -1126,7 +1125,8 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORK
if test -n "$(PY3LIBRARY)"; then \
$(INSTALL_SHARED) $(PY3LIBRARY) $(DESTDIR)$(LIBDIR)/$(PY3LIBRARY); \
Expand Down
11 changes: 10 additions & 1 deletion lang/python36/patches/patch-configure
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$NetBSD: patch-configure,v 1.5 2017/03/30 11:42:58 adam Exp $
$NetBSD: patch-configure,v 1.6 2017/05/23 10:53:56 jperkin Exp $

Simplify _sysconfigdata to include only platform name.

Expand Down Expand Up @@ -90,6 +90,15 @@ Fix linking on Darwin.
if [ "`$CC -dM -E - </dev/null | grep __ELF__`" != "" ]
then
LINKFORSHARED="-Wl,--export-dynamic"
@@ -11122,7 +11125,7 @@ if ${ac_cv_dtrace_link+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_cv_dtrace_link=no
- echo 'BEGIN' > conftest.d
+ echo 'BEGIN {}' > conftest.d
"$DTRACE" -G -s conftest.d -o conftest.o > /dev/null 2>&1 && \
ac_cv_dtrace_link=yes

@@ -14949,8 +14952,6 @@ $as_echo "$SOABI" >&6; }


Expand Down

0 comments on commit 93e60bf

Please sign in to comment.