diff options
-rw-r--r-- | Makefile.pre.in | 4 | ||||
-rw-r--r-- | Misc/NEWS.d/next/Build/2022-06-29-08-58-31.gh-issue-94404.3MadM6.rst | 3 | ||||
-rwxr-xr-x | Modules/makesetup | 7 |
3 files changed, 8 insertions, 6 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in index 004ab3a..3d0e279 100644 --- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -831,7 +831,7 @@ python.worker.js: $(srcdir)/Tools/wasm/python.worker.js ########################################################################## # Build static libmpdec.a -LIBMPDEC_CFLAGS=$(PY_STDMODULE_CFLAGS) $(CCSHARED) @LIBMPDEC_CFLAGS@ +LIBMPDEC_CFLAGS=@LIBMPDEC_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED) # for setup.py DECIMAL_CFLAGS=@LIBMPDEC_CFLAGS@ @@ -889,7 +889,7 @@ $(LIBMPDEC_A): $(LIBMPDEC_OBJS) ########################################################################## # Build static libexpat.a -LIBEXPAT_CFLAGS=$(PY_STDMODULE_CFLAGS) $(CCSHARED) @LIBEXPAT_CFLAGS@ +LIBEXPAT_CFLAGS=@LIBEXPAT_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED) # for setup.py EXPAT_CFLAGS=@LIBEXPAT_CFLAGS@ diff --git a/Misc/NEWS.d/next/Build/2022-06-29-08-58-31.gh-issue-94404.3MadM6.rst b/Misc/NEWS.d/next/Build/2022-06-29-08-58-31.gh-issue-94404.3MadM6.rst index 519a5ce..c7c4753 100644 --- a/Misc/NEWS.d/next/Build/2022-06-29-08-58-31.gh-issue-94404.3MadM6.rst +++ b/Misc/NEWS.d/next/Build/2022-06-29-08-58-31.gh-issue-94404.3MadM6.rst @@ -1,2 +1,3 @@ ``makesetup`` now works around an issue with sed on macOS and uses correct -CFLAGS for object files that end up in a shared extension. +CFLAGS for object files that end up in a shared extension. Module CFLAGS +are used before PY_STDMODULE_CFLAGS to avoid clashes with system headers. diff --git a/Modules/makesetup b/Modules/makesetup index a45b7de..0830381 100755 --- a/Modules/makesetup +++ b/Modules/makesetup @@ -260,13 +260,14 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' | \$*) ;; *) src='$(srcdir)/'"$srcdir/$src";; esac + # custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec case $doconfig in - no) cc="$cc \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)";; + no) cc="$cc $cpps \$(PY_STDMODULE_CFLAGS) \$(CCSHARED)";; *) - cc="$cc \$(PY_BUILTIN_MODULE_CFLAGS)";; + cc="$cc $cpps \$(PY_BUILTIN_MODULE_CFLAGS)";; esac # force rebuild when header file or module build flavor (static/shared) is changed - rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(PYTHON_HEADERS) Modules/config.c; $cc $cpps -c $src -o $obj" + rule="$obj: $src \$(MODULE_${mods_upper}_DEPS) \$(PYTHON_HEADERS) Modules/config.c; $cc -c $src -o $obj" echo "$rule" >>$rulesf done case $doconfig in |