Auto merge of #4318 - str4d:configure-and-build-updates, r=str4d

More updates to the build system

Part of #58 and #4317.
This commit is contained in:
Homu 2020-01-31 15:00:08 +00:00
commit 529f102cac
4 changed files with 39 additions and 40 deletions

View File

@ -97,10 +97,10 @@ AC_ARG_ENABLE([mining],
[enable_mining=yes])
AC_ARG_ENABLE([proton],
[AS_HELP_STRING([--disable-proton],
[disable Proton (AMQP messaging)])],
[AS_HELP_STRING([--enable-proton],
[enable Proton (AMQP messaging) (default is no)])],
[use_proton=$enableval],
[use_proton=yes])
[use_proton=no])
AC_ARG_ENABLE(tests,
AS_HELP_STRING([--disable-tests],[do not compile tests (default is to compile)]),
@ -211,6 +211,12 @@ if test "x$enable_debug" = xyes; then
AX_CHECK_PREPROC_FLAG([-DDEBUG],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_PREPROC_FLAG([-DDEBUG_LOCKORDER],[[DEBUG_CPPFLAGS="$DEBUG_CPPFLAGS -DDEBUG_LOCKORDER"]],,[[$CXXFLAG_WERROR]])
AX_CHECK_COMPILE_FLAG([-ftrapv],[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -ftrapv"],,[[$CXXFLAG_WERROR]])
else
# Even with enable_debug=no we build with standard debug symbols
AX_CHECK_COMPILE_FLAG([-g],[[DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -g"]],,[[$CXXFLAG_WERROR]])
# -ftrapv and -fwrapv conflict, so we only set this if enable_debug=no
AX_CHECK_COMPILE_FLAG([-fwrapv],[CXXFLAGS="$CXXFLAGS -fwrapv"],,[[$CXXFLAG_WERROR]])
fi
if test x$use_sanitizers != x; then
@ -813,7 +819,6 @@ case $host in
esac
# Additional Zcash flags
AX_CHECK_COMPILE_FLAG([-fwrapv],[CXXFLAGS="$CXXFLAGS -fwrapv"])
AX_CHECK_COMPILE_FLAG([-fno-strict-aliasing],[CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"])
AX_CHECK_COMPILE_FLAG([-Wno-builtin-declaration-mismatch],[CXXFLAGS="$CXXFLAGS -Wno-builtin-declaration-mismatch"],,[[$CXXFLAG_WERROR]])

View File

@ -77,7 +77,9 @@ include builders/default.mk
include packages/packages.mk
wallet_packages_$(NO_WALLET) = $(wallet_packages)
proton_packages_$(NO_PROTON) = $(proton_packages)
NO_PROTON_$(WITH_PROTON) = 1
proton_packages_$(NO_PROTON_) = $(proton_packages)
packages += $($(host_arch)_$(host_os)_packages) $($(host_os)_packages) $(rust_packages) $(proton_packages_) $(wallet_packages_)
native_packages += $($(host_arch)_$(host_os)_native_packages) $($(host_os)_native_packages)

View File

@ -4,3 +4,17 @@ release-notes at release time)
Notable changes
===============
Build system
------------
- The `--enable-lcov`, `--disable-tests`, and `--disable-mining` flags for
`zcutil/build.sh` have been removed. You can pass these flags instead by using
the `CONFIGURE_FLAGS` environment variable. For example, to enable coverage
instrumentation (thus enabling "make cov" to work), call:
```
CONFIGURE_FLAGS="--enable-lcov --disable-hardening" ./zcutil/build.sh
```
- The build system no longer defaults to verbose output. You can re-enable
verbose output with `./zcutil/build.sh V=1`

View File

@ -46,54 +46,32 @@ Usage:
$0 --help
Show this help message and exit.
$0 [ --enable-lcov || --disable-tests ] [ --disable-mining ] [ --enable-proton ] [ MAKEARGS... ]
$0 [ --enable-proton ] [ MAKEARGS... ]
Build Zcash and most of its transitive dependencies from
source. MAKEARGS are applied to both dependencies and Zcash itself.
If --enable-lcov is passed, Zcash is configured to add coverage
instrumentation, thus enabling "make cov" to work.
If --disable-tests is passed instead, the Zcash tests are not built.
Pass flags to ./configure using the CONFIGURE_FLAGS environment variable.
For example, to enable coverage instrumentation (thus enabling "make cov"
to work), call:
If --disable-mining is passed, Zcash is configured to not build any mining
code. It must be passed after the test arguments, if present.
CONFIGURE_FLAGS="--enable-lcov --disable-hardening" ./zcutil/build.sh
If --enable-proton is passed, Zcash is configured to build the Apache Qpid Proton
library required for AMQP support. This library is not built by default.
It must be passed after the test/mining arguments, if present.
For verbose output, use:
./zcutil/build.sh V=1
EOF
exit 0
fi
set -x
# If --enable-lcov is the first argument, enable lcov coverage support:
LCOV_ARG=''
HARDENING_ARG='--enable-hardening'
TEST_ARG=''
if [ "x${1:-}" = 'x--enable-lcov' ]
then
LCOV_ARG='--enable-lcov'
HARDENING_ARG='--disable-hardening'
shift
elif [ "x${1:-}" = 'x--disable-tests' ]
then
TEST_ARG='--enable-tests=no'
shift
fi
# If --disable-mining is the next argument, disable mining code:
MINING_ARG=''
if [ "x${1:-}" = 'x--disable-mining' ]
then
MINING_ARG='--enable-mining=no'
shift
fi
# If --enable-proton is the next argument, enable building Proton code:
PROTON_ARG='--enable-proton=no'
PROTON_ARG=''
if [ "x${1:-}" = 'x--enable-proton' ]
then
PROTON_ARG=''
PROTON_ARG='--enable-proton'
shift
fi
@ -101,7 +79,7 @@ eval "$MAKE" --version
as --version
ld -v
HOST="$HOST" BUILD="$BUILD" NO_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/ V=1
HOST="$HOST" BUILD="$BUILD" WITH_PROTON="$PROTON_ARG" "$MAKE" "$@" -C ./depends/
./autogen.sh
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$HARDENING_ARG" "$LCOV_ARG" "$TEST_ARG" "$MINING_ARG" "$PROTON_ARG" $CONFIGURE_FLAGS CXXFLAGS='-g'
"$MAKE" "$@" V=1
CONFIG_SITE="$PWD/depends/$HOST/share/config.site" ./configure "$PROTON_ARG" $CONFIGURE_FLAGS
"$MAKE" "$@"