Changeset View
Changeset View
Standalone View
Standalone View
configure.ac
Show First 20 Lines • Show All 137 Lines • ▼ Show 20 Lines | |||||
AC_ARG_WITH([qrencode], | AC_ARG_WITH([qrencode], | ||||
[AS_HELP_STRING([--with-qrencode], | [AS_HELP_STRING([--with-qrencode], | ||||
[enable QR code support (default is yes if qt is enabled and libqrencode is found)])], | [enable QR code support (default is yes if qt is enabled and libqrencode is found)])], | ||||
[use_qr=$withval], | [use_qr=$withval], | ||||
[use_qr=auto]) | [use_qr=auto]) | ||||
AC_ARG_ENABLE([hardening], | AC_ARG_ENABLE([hardening], | ||||
[AS_HELP_STRING([--disable-hardening], | [AS_HELP_STRING([--disable-hardening], | ||||
[do not attempt to harden the resulting executables (default is to harden)])], | [do not attempt to harden the resulting executables (default is to harden when possible)])], | ||||
[use_hardening=$enableval], | [use_hardening=$enableval], | ||||
[use_hardening=yes]) | [use_hardening=auto]) | ||||
AC_ARG_ENABLE([reduce-exports], | AC_ARG_ENABLE([reduce-exports], | ||||
[AS_HELP_STRING([--enable-reduce-exports], | [AS_HELP_STRING([--enable-reduce-exports], | ||||
[attempt to reduce exported symbols in the resulting executables (default is no)])], | [attempt to reduce exported symbols in the resulting executables (default is no)])], | ||||
[use_reduce_exports=$enableval], | [use_reduce_exports=$enableval], | ||||
[use_reduce_exports=no]) | [use_reduce_exports=no]) | ||||
AC_ARG_ENABLE([ccache], | AC_ARG_ENABLE([ccache], | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
# Enable debug | # Enable debug | ||||
AC_ARG_ENABLE([debug], | AC_ARG_ENABLE([debug], | ||||
[AS_HELP_STRING([--enable-debug], | [AS_HELP_STRING([--enable-debug], | ||||
[use compiler flags and macros suited for debugging (default is no)])], | [use compiler flags and macros suited for debugging (default is no)])], | ||||
[enable_debug=$enableval], | [enable_debug=$enableval], | ||||
[enable_debug=no]) | [enable_debug=no]) | ||||
# Enable gprof profiling | |||||
AC_ARG_ENABLE([gprof], | |||||
[AS_HELP_STRING([--enable-gprof], | |||||
[use gprof profiling compiler flags (default is no)])], | |||||
[enable_gprof=$enableval], | |||||
[enable_gprof=no]) | |||||
# Enable different -fsanitize options | # Enable different -fsanitize options | ||||
AC_ARG_WITH([sanitizers], | AC_ARG_WITH([sanitizers], | ||||
[AS_HELP_STRING([--with-sanitizers], | [AS_HELP_STRING([--with-sanitizers], | ||||
[comma separated list of extra sanitizers to build with (default is none enabled)])], | [comma separated list of extra sanitizers to build with (default is none enabled)])], | ||||
[use_sanitizers=$withval]) | [use_sanitizers=$withval]) | ||||
# Turn warnings into errors | # Turn warnings into errors | ||||
AC_ARG_ENABLE([werror], | AC_ARG_ENABLE([werror], | ||||
▲ Show 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | if test x$use_glibc_compat != xno; then | ||||
if test x$need_wrap_fcntl = xyes; then | if test x$need_wrap_fcntl = xyes; then | ||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=fcntl]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=fcntl"]) | AX_CHECK_LINK_FLAG([[-Wl,--wrap=fcntl]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=fcntl"]) | ||||
AX_CHECK_LINK_FLAG([[-Wl,--wrap=fcntl64]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=fcntl64"]) | AX_CHECK_LINK_FLAG([[-Wl,--wrap=fcntl64]], [COMPAT_LDFLAGS="$COMPAT_LDFLAGS -Wl,--wrap=fcntl64"]) | ||||
fi | fi | ||||
else | else | ||||
AC_SEARCH_LIBS([clock_gettime],[rt]) | AC_SEARCH_LIBS([clock_gettime],[rt]) | ||||
fi | fi | ||||
if test "x$enable_gprof" = xyes; then | |||||
dnl -pg is incompatible with -pie. Since hardening and profiling together doesn't make sense, | |||||
dnl we simply make them mutually exclusive here. Additionally, hardened toolchains may force | |||||
dnl -pie by default, in which case it needs to be turned off with -no-pie. | |||||
if test x$use_hardening = xyes; then | |||||
AC_MSG_ERROR(gprof profiling is not compatible with hardening. Reconfigure with --disable-hardening or --disable-gprof) | |||||
fi | |||||
use_hardening=no | |||||
AX_CHECK_COMPILE_FLAG([-pg],[GPROF_CXXFLAGS="-pg"], | |||||
[AC_MSG_ERROR(gprof profiling requested but not available)], [[$CXXFLAG_WERROR]]) | |||||
AX_CHECK_LINK_FLAG([[-no-pie]], [GPROF_LDFLAGS="-no-pie"]) | |||||
AX_CHECK_LINK_FLAG([[-pg]],[GPROF_LDFLAGS="$GPROF_LDFLAGS -pg"], | |||||
[AC_MSG_ERROR(gprof profiling requested but not available)], [[$GPROF_LDFLAGS]]) | |||||
fi | |||||
if test x$TARGET_OS != xwindows; then | if test x$TARGET_OS != xwindows; then | ||||
# All windows code is PIC, forcing it on just adds useless compile warnings | # All windows code is PIC, forcing it on just adds useless compile warnings | ||||
AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"]) | AX_CHECK_COMPILE_FLAG([-fPIC],[PIC_FLAGS="-fPIC"]) | ||||
fi | fi | ||||
# All versions of gcc that we commonly use for building are subject to bug | # All versions of gcc that we commonly use for building are subject to bug | ||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set | # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90348. To work around that, set | ||||
# -fstack-reuse=none for all gcc builds. (Only gcc understands this flag) | # -fstack-reuse=none for all gcc builds. (Only gcc understands this flag) | ||||
AX_CHECK_COMPILE_FLAG([-fstack-reuse=none],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"]) | AX_CHECK_COMPILE_FLAG([-fstack-reuse=none],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-reuse=none"]) | ||||
if test x$use_hardening != xno; then | if test x$use_hardening != xno; then | ||||
use_hardening=yes | |||||
AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) | AX_CHECK_COMPILE_FLAG([-Wstack-protector],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -Wstack-protector"]) | ||||
AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) | AX_CHECK_COMPILE_FLAG([-fstack-protector-all],[HARDENED_CXXFLAGS="$HARDENED_CXXFLAGS -fstack-protector-all"]) | ||||
AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ | AX_CHECK_PREPROC_FLAG([-D_FORTIFY_SOURCE=2],[ | ||||
AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ | AX_CHECK_PREPROC_FLAG([-U_FORTIFY_SOURCE],[ | ||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" | HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -U_FORTIFY_SOURCE" | ||||
]) | ]) | ||||
HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2" | HARDENED_CPPFLAGS="$HARDENED_CPPFLAGS -D_FORTIFY_SOURCE=2" | ||||
▲ Show 20 Lines • Show All 559 Lines • ▼ Show 20 Lines | |||||
AC_SUBST(RELDFLAGS) | AC_SUBST(RELDFLAGS) | ||||
AC_SUBST(DEBUG_CPPFLAGS) | AC_SUBST(DEBUG_CPPFLAGS) | ||||
AC_SUBST(WARN_CXXFLAGS) | AC_SUBST(WARN_CXXFLAGS) | ||||
AC_SUBST(NOWARN_CXXFLAGS) | AC_SUBST(NOWARN_CXXFLAGS) | ||||
AC_SUBST(DEBUG_CXXFLAGS) | AC_SUBST(DEBUG_CXXFLAGS) | ||||
AC_SUBST(COMPAT_LDFLAGS) | AC_SUBST(COMPAT_LDFLAGS) | ||||
AC_SUBST(ERROR_CXXFLAGS) | AC_SUBST(ERROR_CXXFLAGS) | ||||
AC_SUBST(GPROF_CXXFLAGS) | |||||
AC_SUBST(GPROF_LDFLAGS) | |||||
AC_SUBST(HARDENED_CXXFLAGS) | AC_SUBST(HARDENED_CXXFLAGS) | ||||
AC_SUBST(HARDENED_CPPFLAGS) | AC_SUBST(HARDENED_CPPFLAGS) | ||||
AC_SUBST(HARDENED_LDFLAGS) | AC_SUBST(HARDENED_LDFLAGS) | ||||
AC_SUBST(PIC_FLAGS) | AC_SUBST(PIC_FLAGS) | ||||
AC_SUBST(PIE_FLAGS) | AC_SUBST(PIE_FLAGS) | ||||
AC_SUBST(SANITIZER_CXXFLAGS) | AC_SUBST(SANITIZER_CXXFLAGS) | ||||
AC_SUBST(SANITIZER_LDFLAGS) | AC_SUBST(SANITIZER_LDFLAGS) | ||||
AC_SUBST(SSE42_CXXFLAGS) | AC_SUBST(SSE42_CXXFLAGS) | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | |||||
fi | fi | ||||
echo " with zmq = $use_zmq" | echo " with zmq = $use_zmq" | ||||
echo " with test = $use_tests" | echo " with test = $use_tests" | ||||
echo " with bench = $use_bench" | echo " with bench = $use_bench" | ||||
echo " with upnp = $use_upnp" | echo " with upnp = $use_upnp" | ||||
echo " use asm = $use_asm" | echo " use asm = $use_asm" | ||||
echo " sanitizers = $use_sanitizers" | echo " sanitizers = $use_sanitizers" | ||||
echo " debug enabled = $enable_debug" | echo " debug enabled = $enable_debug" | ||||
echo " gprof enabled = $enable_gprof" | |||||
echo " werror = $enable_werror" | echo " werror = $enable_werror" | ||||
echo | echo | ||||
echo " target os = $TARGET_OS" | echo " target os = $TARGET_OS" | ||||
echo " build os = $BUILD_OS" | echo " build os = $BUILD_OS" | ||||
echo | echo | ||||
echo " CC = $CC" | echo " CC = $CC" | ||||
echo " CFLAGS = $CFLAGS" | echo " CFLAGS = $CFLAGS" | ||||
echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS" | echo " CPPFLAGS = $DEBUG_CPPFLAGS $HARDENED_CPPFLAGS $CPPFLAGS" | ||||
echo " CXX = $CXX" | echo " CXX = $CXX" | ||||
echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $CXXFLAGS" | echo " CXXFLAGS = $DEBUG_CXXFLAGS $HARDENED_CXXFLAGS $WARN_CXXFLAGS $NOWARN_CXXFLAGS $ERROR_CXXFLAGS $CXXFLAGS" | ||||
echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $LDFLAGS" | echo " LDFLAGS = $PTHREAD_CFLAGS $HARDENED_LDFLAGS $LDFLAGS" | ||||
echo " ARFLAGS = $ARFLAGS" | echo " ARFLAGS = $ARFLAGS" | ||||
echo | echo |