File tree Expand file tree Collapse file tree 3 files changed +8
-6
lines changed
Expand file tree Collapse file tree 3 files changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -829,7 +829,7 @@ python.worker.js: $(srcdir)/Tools/wasm/python.worker.js
829829
830830##########################################################################
831831# Build static libmpdec.a
832- LIBMPDEC_CFLAGS=$(PY_STDMODULE_CFLAGS) $(CCSHARED) @LIBMPDEC_CFLAGS@
832+ LIBMPDEC_CFLAGS=@LIBMPDEC_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED)
833833
834834# for setup.py
835835DECIMAL_CFLAGS=@LIBMPDEC_CFLAGS@
@@ -887,7 +887,7 @@ $(LIBMPDEC_A): $(LIBMPDEC_OBJS)
887887
888888##########################################################################
889889# Build static libexpat.a
890- LIBEXPAT_CFLAGS=$(PY_STDMODULE_CFLAGS) $(CCSHARED) @LIBEXPAT_CFLAGS@
890+ LIBEXPAT_CFLAGS=@LIBEXPAT_CFLAGS@ $(PY_STDMODULE_CFLAGS) $(CCSHARED)
891891
892892# for setup.py
893893EXPAT_CFLAGS=@LIBEXPAT_CFLAGS@
Original file line number Diff line number Diff line change 11``makesetup `` now works around an issue with sed on macOS and uses correct
2- CFLAGS for object files that end up in a shared extension.
2+ CFLAGS for object files that end up in a shared extension. Module CFLAGS
3+ are used before PY_STDMODULE_CFLAGS to avoid clashes with system headers.
Original file line number Diff line number Diff line change @@ -260,13 +260,14 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
260260 \$ * ) ;;
261261 * ) src=' $(srcdir)/' " $srcdir /$src " ;;
262262 esac
263+ # custom flags first, PY_STDMODULE_CFLAGS may contain -I with system libmpdec
263264 case $doconfig in
264- no) cc=" $cc \$ (PY_STDMODULE_CFLAGS) \$ (CCSHARED)" ;;
265+ no) cc=" $cc $cpps \$ (PY_STDMODULE_CFLAGS) \$ (CCSHARED)" ;;
265266 * )
266- cc=" $cc \$ (PY_BUILTIN_MODULE_CFLAGS)" ;;
267+ cc=" $cc $cpps \$ (PY_BUILTIN_MODULE_CFLAGS)" ;;
267268 esac
268269 # force rebuild when header file or module build flavor (static/shared) is changed
269- rule=" $obj : $src \$ (MODULE_${mods_upper} _DEPS) \$ (PYTHON_HEADERS) Modules/config.c; $cc $cpps -c $src -o $obj "
270+ rule=" $obj : $src \$ (MODULE_${mods_upper} _DEPS) \$ (PYTHON_HEADERS) Modules/config.c; $cc -c $src -o $obj "
270271 echo " $rule " >> $rulesf
271272 done
272273 case $doconfig in
You can’t perform that action at this time.
0 commit comments