bpo-31354: Let configure --with-lto work on all builds · python/cpython@4c81401

Original file line numberDiff line numberDiff line change

@@ -1282,9 +1282,8 @@ else

12821282

fi

12831283
12841284

# Enable LTO flags

1285-

AC_SUBST(LTOFLAGS)

12861285

AC_MSG_CHECKING(for --with-lto)

1287-

AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in PGO builds. Disabled by default.]),

1286+

AC_ARG_WITH(lto, AS_HELP_STRING([--with-lto], [Enable Link Time Optimization in any build. Disabled by default.]),

12881287

[

12891288

if test "$withval" != no

12901289

then

@@ -1319,6 +1318,8 @@ if test "$Py_LTO" = 'true' ; then

13191318

esac

13201319

;;

13211320

esac

1321+

CFLAGS="$CFLAGS $LTOFLAGS"

1322+

LDFLAGS="$LDFLAGS $LTOFLAGS"

13221323

fi

13231324
13241325

# Enable PGO flags.