cpython: 1e61cc86df03 (original) (raw)

Mercurial > cpython

changeset 103182:1e61cc86df03 3.5

Issue #26359: Add the --with-optimizations flag. [#26359]

Brett Cannon brett@python.org
date Tue, 06 Sep 2016 17:15:21 -0700
parents 7d9cd4a0d488
children f9b52b31f1b4 5f3f6f1fb73a
files Makefile.pre.in Misc/NEWS configure configure.ac
diffstat 4 files changed, 103 insertions(+), 17 deletions(-)[+] [-] Makefile.pre.in 8 Misc/NEWS 2 configure 69 configure.ac 41

line wrap: on

line diff

--- a/Makefile.pre.in +++ b/Makefile.pre.in @@ -481,7 +481,7 @@ LIBRARY_OBJS= [](#l1.3)

Rules

Default target

-all: build_all +all: @DEF_MAKE_ALL_RULE@ build_all: $(BUILDPYTHON) oldsharedmods sharedmods gdbhooks Programs/_testembed python-config

Compile a binary with profile guided optimization.

@@ -505,7 +505,7 @@ profile-opt: $(MAKE) profile-removal build_all_generate_profile:

Compile and run with gcov

.PHONY=coverage coverage-lcov coverage-report coverage: @echo "Building with support for coverage checking:" $(MAKE) clean profile-removal

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -256,6 +256,8 @@ Windows Build ----- +- Issue #26359: Add the --with-optimizations configure flag. +

--- a/configure +++ b/configure @@ -674,6 +674,8 @@ LLVM_PROF_MERGER PGO_PROF_USE_FLAG PGO_PROF_GEN_FLAG LTOFLAGS +DEF_MAKE_RULE +DEF_MAKE_ALL_RULE ABIFLAGS LN MKDIR_P @@ -774,7 +776,6 @@ infodir docdir oldincludedir includedir -runstatedir localstatedir sharedstatedir sysconfdir @@ -808,6 +809,7 @@ with_suffix enable_shared enable_profiling with_pydebug +with_optimizations with_lto with_hash_algorithm with_address_sanitizer @@ -885,7 +887,6 @@ datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' @@ -1138,15 +1139,6 @@ do | -silent | --silent | --silen | --sile | --sil) silent=yes ;;

- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* [](#l3.51) @@ -1284,7 +1276,7 @@ fi for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir [](#l3.53) datadir sysconfdir sharedstatedir localstatedir includedir [](#l3.54) oldincludedir docdir infodir htmldir dvidir pdfdir psdir [](#l3.55) - libdir localedir mandir runstatedir + libdir localedir mandir do eval ac_val=$$ac_var

Remove trailing slashes.

@@ -1437,7 +1429,6 @@ Fine tuning of the installation director --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var]

Enable LTO flags

{ asecho"as_echo "asecho"as_me:${as_lineno-$LINENO}: checking for --with-lto" >&5 @@ -17636,3 +17669,13 @@ echo "creating Makefile" >&6 -s Modules Modules/Setup.config [](#l3.126) Modules/Setup.local Modules/Setup mv config.c Modules + +if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then

+fi +

--- a/configure.ac +++ b/configure.ac @@ -1230,6 +1230,37 @@ else AC_MSG_RESULT(no); Py_DEBUG='false' fi], [AC_MSG_RESULT(no)]) +# Enable optimization flags +AC_SUBST(DEF_MAKE_ALL_RULE) +AC_SUBST(DEF_MAKE_RULE) +Py_OPT='false' +AC_MSG_CHECKING(for --with-optimizations) +AC_ARG_WITH(optimizations, AS_HELP_STRING([--with-optimizations], [Enable all optimizations when available (LTO, PGO, etc). Disabled by default.]), +[ +if test "$withval" != no +then

Enable LTO flags

AC_SUBST(LTOFLAGS) AC_MSG_CHECKING(for --with-lto) @@ -5299,3 +5330,13 @@ echo "creating Makefile" >&AS_MESSAGE_FD -s Modules Modules/Setup.config [](#l4.42) Modules/Setup.local Modules/Setup mv config.c Modules + +if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then

+fi +