New submission from Christian Heimes <li...@cheimes.de>:

Compiler and linker flags for _decimal and internal libmpdec are currently 
handled by a mix of configure checks and if/else chains in setup.py. The split 
makes it harder to build _decimal correctly from Modules/Setup. The 
Modules/Setup file also does not handle --with-system-mpdec.

I have a working PR that moves all logic into configure.ac. The new system:

* sets LIBMPDEC_CFLAGS and LIBMPDEC_LDFLAGS based on --with-system-libmpdec 
value.

* detects libmpdec_machine by looking at ac_sys_system, MACOSX_DEFAULT_ARCH, 
ac_cv_sizeof_size_t, ac_cv_gcc_asm_for_x64, ac_cv_type___uint128_t, and 
ac_cv_gcc_asm_for_x87.

* sets libmpdec compiler args based on libmpdec_machine, 
have_ipa_pure_const_bug, and have_glibc_memmove_bug.

* if --with-system-libmpdec is not given, then our Makefile compiles libmpdec 
objects and puts them into a libmpdec.a archive.

* finally it either links _decimal with our libmpdec.a or with system's 
libmpdec shared library.

I went for libmpdec.a because it makes the logic for the internal path look 
similar to the logic with linking with an external shared library.

Modules/Setup

----------
assignee: christian.heimes
components: Build
messages: 406271
nosy: christian.heimes, mark.dickinson, pitrou
priority: normal
severity: normal
stage: patch review
status: open
title: Move _decimal build setup into configure
type: enhancement
versions: Python 3.11

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

Reply via email to