Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-45573: Introduce extension module flags in Makefile (GH-29594) #29594

Merged
merged 1 commit into from Nov 18, 2021

Conversation

Copy link
Member

@tiran tiran commented Nov 17, 2021

configure now uses a standardized format to forward state, compiler
flags, and linker flags to Makefile, setup.py, and
Modules/Setup. makesetup use the new variables by default if a
module line does not contain any compiler or linker flags. setup.py
has a new function addext().

For a module egg, configure adds:

  • MODULE_EGG with value yes, missing, disabled, or n/a
  • MODULE_EGG_CFLAGS
  • MODULE_EGG_LDFLAGS

Makefile.pre.in may also provide MODULE_EGG_DEPS that lists
dependencies such as header files and static libs.

Signed-off-by: Christian Heimes christian@python.org

https://bugs.python.org/issue45573

``configure`` now uses a standardized format to forward state, compiler
flags, and linker flags to ``Makefile``, ``setup.py``, and
``Modules/Setup``. ``makesetup`` use the new variables by default if a
module line does not contain any compiler or linker flags. ``setup.py``
has a new function ``addext()``.

For a module ``egg``, configure adds:

* ``MODULE_EGG`` with value yes, missing, disabled, or n/a
* ``MODULE_EGG_CFLAGS``
* ``MODULE_EGG_LDFLAGS``

``Makefile.pre.in`` may also provide ``MODULE_EGG_DEPS`` that lists
dependencies such as header files and static libs.

Signed-off-by: Christian Heimes <christian@python.org>
@tiran tiran marked this pull request as ready for review Nov 17, 2021
@tiran tiran force-pushed the bpo-45573-configure-mod branch from 6eb4638 to 23986fc Compare Nov 17, 2021
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Great work! LG

# not available on current platform
pass
else:
# not migrated to MODULE_{name} yet.
Copy link
Contributor

@erlend-aasland erlend-aasland Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps print an info message?

Copy link
Member Author

@tiran tiran Nov 18, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good thinking, I plan to add an error message after we have ported all stdlib modules to new system.

if cflags:
for token in shlex.split(cflags):
Copy link
Contributor

@erlend-aasland erlend-aasland Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, it would have been convenient to be able write for token in shlex.split(cflags) if cflags: :)

Copy link
Contributor

@ambv ambv Nov 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can for token in shlex.split(cflags) if cflags else (): if you really want to but I find the boring vanilla form less clever which is a Good Thing.

@tiran tiran changed the title bpo-45573: Introduce extension module flags in Makefile bpo-45573: Introduce extension module flags in Makefile (GH-29594) Nov 18, 2021
@tiran tiran merged commit 25ecc04 into python:main Nov 18, 2021
12 checks passed
@tiran tiran deleted the bpo-45573-configure-mod branch Nov 18, 2021
remykarem added a commit to remykarem/cpython that referenced this issue Dec 7, 2021
``configure`` now uses a standardized format to forward state, compiler
flags, and linker flags to ``Makefile``, ``setup.py``, and
``Modules/Setup``. ``makesetup`` use the new variables by default if a
module line does not contain any compiler or linker flags. ``setup.py``
has a new function ``addext()``.

For a module ``egg``, configure adds:

* ``MODULE_EGG`` with value yes, missing, disabled, or n/a
* ``MODULE_EGG_CFLAGS``
* ``MODULE_EGG_LDFLAGS``

``Makefile.pre.in`` may also provide ``MODULE_EGG_DEPS`` that lists
dependencies such as header files and static libs.

Signed-off-by: Christian Heimes <christian@python.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants