Marc-Andre Lemburg <m...@egenix.com> added the comment:

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.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue45548>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to