mirror of
https://github.com/dashpay/dash.git
synced 2024-12-26 04:22:55 +01:00
685b7a7a1b
094772656d71b3f5022ae292094e878da035de9e build: support LTO in depends (fanquake) Pull request description: This adds an `LTO` option to depends, i.e `make -C depends LTO=1`, which passes `-flto` when building packages (not currently qt), and automatically configures with `--enable-lto` when doing a build using a `CONFIG_SITE`. The following tables comapres the size (in bytes) of the stripped `x86_64` Linux binaries produced with master and this PR (full depends build): | Binary | stripped master | stripped LTO=1 | saving | | -------- | ----------------: | -------------: | --------: | | bitcoin-cli | 1178632 | 469872 | 60% | | bitcoin-tx | 2710584 | 1866504 | 31% | | bitcoin-util | 952880 | 240104 | 74% | | bitcoin-wallet | 7992888 | 5365984 | 32% | | bitcoind | 13421336 | 11868592 | 12% | | bitcoin-qt | 37680496 | 31640976 | 16% | ACKs for top commit: laanwj: Tested ACK 094772656d71b3f5022ae292094e878da035de9e Tree-SHA512: 6b8483ea490e57a153105ad8c38b25fb1af5d55b1af22db398c7c2573612aaf71b4d2b4cf09c18fd6331b1358dba01641eeaa03e5018a925392e1937118d984a
138 lines
3.3 KiB
Plaintext
138 lines
3.3 KiB
Plaintext
# shellcheck shell=sh disable=SC2034 # Many variables set will be used in
|
|
# ./configure but shellcheck doesn't know
|
|
# that, hence: disable=SC2034
|
|
|
|
true # Dummy command because shellcheck treats all directives before first
|
|
# command as file-wide, and we only want to disable for one line.
|
|
#
|
|
# See: https://github.com/koalaman/shellcheck/wiki/Directive
|
|
|
|
# shellcheck disable=SC2154
|
|
depends_prefix="$(cd "$(dirname "$ac_site_file")/.." && pwd)"
|
|
|
|
cross_compiling=maybe
|
|
host_alias="@HOST@"
|
|
ac_tool_prefix="${host_alias}-"
|
|
|
|
if test -z "$with_boost"; then
|
|
with_boost="$depends_prefix"
|
|
fi
|
|
if test -z "$with_qt_plugindir"; then
|
|
with_qt_plugindir="${depends_prefix}/plugins"
|
|
fi
|
|
if test -z "$with_qt_translationdir"; then
|
|
with_qt_translationdir="${depends_prefix}/translations"
|
|
fi
|
|
if test -z "$with_qt_bindir" && test -z "@no_qt@"; then
|
|
with_qt_bindir="${depends_prefix}/native/bin"
|
|
fi
|
|
if test -z "$with_mpgen" && test -n "@multiprocess@"; then
|
|
with_mpgen="${depends_prefix}/native"
|
|
fi
|
|
|
|
if test -z "$with_qrencode" && test -n "@no_qr@"; then
|
|
with_qrencode=no
|
|
fi
|
|
|
|
if test -z "$enable_wallet" && test -n "@no_wallet@"; then
|
|
enable_wallet=no
|
|
fi
|
|
|
|
if test -z "$with_bdb" && test -n "@no_bdb@"; then
|
|
with_bdb=no
|
|
fi
|
|
|
|
if test -z "$with_sqlite" && test -n "@no_sqlite@"; then
|
|
with_sqlite=no
|
|
fi
|
|
|
|
if test -z "$enable_multiprocess" && test -n "@multiprocess@"; then
|
|
enable_multiprocess=yes
|
|
fi
|
|
|
|
if test -z "$with_miniupnpc" && test -n "@no_upnp@"; then
|
|
with_miniupnpc=no
|
|
fi
|
|
|
|
if test -z "$with_natpmp" && test -n "@no_natpmp@"; then
|
|
with_natpmp=no
|
|
fi
|
|
|
|
if test -z "$with_gui" && test -n "@no_qt@"; then
|
|
with_gui=no
|
|
fi
|
|
|
|
if test -n "@debug@" && test -z "@no_qt@" && test "x$with_gui" != xno; then
|
|
with_gui=qt5_debug
|
|
fi
|
|
|
|
if test -z "$enable_zmq" && test -n "@no_zmq@"; then
|
|
enable_zmq=no
|
|
fi
|
|
|
|
if test -z "$enable_usdt" && test -n "@no_usdt@"; then
|
|
enable_usdt=no
|
|
fi
|
|
|
|
if test "@host_os@" = darwin; then
|
|
BREW=no
|
|
fi
|
|
|
|
if test -z "$enable_lto" && test -n "@lto@"; then
|
|
enable_lto=yes
|
|
fi
|
|
|
|
PATH="${depends_prefix}/native/bin:${PATH}"
|
|
PKG_CONFIG="$(which pkg-config) --static"
|
|
|
|
# These two need to remain exported because pkg-config does not see them
|
|
# otherwise. That means they must be unexported at the end of configure.ac to
|
|
# avoid ruining the cache. Sigh.
|
|
export PKG_CONFIG_PATH="${depends_prefix}/share/pkgconfig:${depends_prefix}/lib/pkgconfig"
|
|
if test -z "@allow_host_packages@"; then
|
|
export PKG_CONFIG_LIBDIR="${depends_prefix}/lib/pkgconfig"
|
|
fi
|
|
|
|
CPPFLAGS="-I${depends_prefix}/include/ ${CPPFLAGS}"
|
|
LDFLAGS="-L${depends_prefix}/lib ${LDFLAGS}"
|
|
|
|
if test -n "@CC@" -a -z "${CC}"; then
|
|
CC="@CC@"
|
|
fi
|
|
if test -n "@CXX@" -a -z "${CXX}"; then
|
|
CXX="@CXX@"
|
|
fi
|
|
PYTHONPATH="${depends_prefix}/native/lib/python3/dist-packages${PYTHONPATH:+${PATH_SEPARATOR}}${PYTHONPATH}"
|
|
|
|
if test -n "@AR@"; then
|
|
AR="@AR@"
|
|
ac_cv_path_ac_pt_AR="${AR}"
|
|
fi
|
|
|
|
if test -n "@RANLIB@"; then
|
|
RANLIB="@RANLIB@"
|
|
ac_cv_path_ac_pt_RANLIB="${RANLIB}"
|
|
fi
|
|
|
|
if test -n "@NM@"; then
|
|
NM="@NM@"
|
|
ac_cv_path_ac_pt_NM="${NM}"
|
|
fi
|
|
|
|
if test -n "@debug@"; then
|
|
enable_reduce_exports=no
|
|
fi
|
|
|
|
if test -n "@CFLAGS@"; then
|
|
CFLAGS="@CFLAGS@ ${CFLAGS}"
|
|
fi
|
|
if test -n "@CXXFLAGS@"; then
|
|
CXXFLAGS="@CXXFLAGS@ ${CXXFLAGS}"
|
|
fi
|
|
if test -n "@CPPFLAGS@"; then
|
|
CPPFLAGS="@CPPFLAGS@ ${CPPFLAGS}"
|
|
fi
|
|
if test -n "@LDFLAGS@"; then
|
|
LDFLAGS="@LDFLAGS@ ${LDFLAGS}"
|
|
fi
|