File tree 2 files changed +13
-5
lines changed
2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change
1
+ ``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.
Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
+ set -e
2
3
3
4
# Convert templates into Makefile and config.c, based on the module
4
5
# definitions found in the file Setup.
@@ -260,7 +261,7 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
260
261
* ) src=' $(srcdir)/' " $srcdir /$src " ;;
261
262
esac
262
263
case $doconfig in
263
- no) cc=" $cc \$ (CCSHARED ) \$ (PY_CFLAGS_NODIST) \$ (PY_CPPFLAGS )" ;;
264
+ no) cc=" $cc \$ (PY_STDMODULE_CFLAGS ) \$ (CCSHARED )" ;;
264
265
* )
265
266
cc=" $cc \$ (PY_BUILTIN_MODULE_CFLAGS)" ;;
266
267
esac
@@ -322,8 +323,13 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
322
323
323
324
case $makepre in
324
325
-) ;;
325
- * ) sedf=" @sed.in.$$ "
326
- trap ' rm -f $sedf' 0 1 2 3
326
+ * )
327
+ # macOS' sed has issues with 'a' command. Use 'r' command with an
328
+ # external replacement file instead.
329
+ sedf=" @sed.in.$$ "
330
+ sedr=" @sed.replace.$$ "
331
+ trap ' rm -f $sedf $sedr' 0 1 2 3
332
+ echo " $NL$NL$DEFS " | sed ' s/\\$//' > $sedr
327
333
echo " 1i\\ " > $sedf
328
334
str=" # Generated automatically from $makepre by makesetup."
329
335
echo " $str " >> $sedf
@@ -332,10 +338,10 @@ sed -e 's/[ ]*#.*//' -e '/^[ ]*$/d' |
332
338
echo " s%_MODDISABLED_NAMES_%$DISABLED %" >> $sedf
333
339
echo " s%_MODOBJS_%$OBJS %" >> $sedf
334
340
echo " s%_MODLIBS_%$LIBS %" >> $sedf
335
- echo " /Definitions added by makesetup/a $NL$NL$DEFS " >> $sedf
341
+ echo " /Definitions added by makesetup/r $sedr " >> $sedf
336
342
sed -f $sedf $makepre > Makefile
337
343
cat $rulesf >> Makefile
338
- rm -f $sedf
344
+ rm -f $sedf $sedr
339
345
;;
340
346
esac
341
347
You can’t perform that action at this time.
0 commit comments