Skip to content

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

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

Merged
merged 1 commit into from
Nov 18, 2021

Conversation

tiran
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 [email protected]

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 <[email protected]>
@tiran tiran marked this pull request as ready for review November 17, 2021 18:06
@tiran tiran force-pushed the bpo-45573-configure-mod branch from 6eb4638 to 23986fc Compare November 17, 2021 18:06
Copy link
Contributor

@erlend-aasland erlend-aasland left a comment

Choose a reason for hiding this comment

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

Great work! LG

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

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

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.

Comment on lines +417 to +418
if cflags:
for token in shlex.split(cflags):
Copy link
Contributor

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

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
@tiran tiran deleted the bpo-45573-configure-mod branch November 18, 2021 08:18
remykarem pushed a commit to remykarem/cpython that referenced this pull request 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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants