This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author lemburg
Recipients brett.cannon, christian.heimes, lemburg, miss-islington, ned.deily, zach.ware
Date 2021-10-23.18:18:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <145e2c9b-d931-6770-f115-8dc8de8531cf@egenix.com>
In-reply-to <1635012262.51.0.699333528666.issue45548@roundup.psfhosted.org>
Content
I'm using a very simple conditional logic in Setup, which is based
on sed, mostly to add platform specific variables:

In Setup:

# @if macosx: TIME_DEFS=
# @if not macosx: TIME_DEFS=-lrt
time -DPy_BUILD_CORE_BUILTIN -I$(srcdir)/Include/internal timemodule.c
$(TIME_DEFS) # -lm # time operations and variables

In Makefile:

        # Install the custom Modules/Setup file
        if test "$(MACOSX_PLATFORM)"; then \
                sed     -e 's/# @if macosx: *//' \
                        $(PYRUNDIR)/$(MODULESSETUP) > $(PYTHONDIR)/Modules/Setup; \
        elif test "$(FREEBSD_PLATFORM)"; then \
                sed     -e 's/# @if freebsd: *//' \
                        $(PYRUNDIR)/$(MODULESSETUP) > $(PYTHONDIR)/Modules/Setup; \
        else \
                sed     -e 's/# @if not macosx: *//' \
                        -e 's/# @if not freebsd: *//' \
                        $(PYRUNDIR)/$(MODULESSETUP) > $(PYTHONDIR)/Modules/Setup; \
        fi;

Setup used to be templated as well in the past, but that logic was removed
at some point. Perhaps it's time to reintroduce it.
History
Date User Action Args
2021-10-23 18:18:09lemburgsetrecipients: + lemburg, brett.cannon, christian.heimes, ned.deily, zach.ware, miss-islington
2021-10-23 18:18:09lemburglinkissue45548 messages
2021-10-23 18:18:09lemburgcreate