2020-05-08 23:45:08 +02:00
|
|
|
AC_PREREQ([2.63])
|
2016-07-25 02:33:26 +02:00
|
|
|
AUTOMAKE_OPTIONS = 1.11
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_INIT([construct],[1])
|
2020-03-11 05:56:41 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_GNU_SOURCE
|
|
|
|
AC_USE_SYSTEM_EXTENSIONS
|
2019-12-01 22:12:31 +01:00
|
|
|
|
2020-07-12 20:48:48 +02:00
|
|
|
AC_CANONICAL_HOST
|
|
|
|
AC_CANONICAL_BUILD
|
|
|
|
AC_CANONICAL_TARGET
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
AC_PREFIX_DEFAULT([/])
|
2018-09-18 02:19:31 +02:00
|
|
|
AC_CONFIG_MACRO_DIR([tools/m4])
|
2019-12-01 22:12:31 +01:00
|
|
|
AC_CONFIG_HEADER(include/ircd/config.h)
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_PATH_PROG(AUTOMAKE, automake)
|
|
|
|
AC_PATH_PROG(ACLOCAL, aclocal)
|
|
|
|
AC_PATH_PROG(AUTOHEADER, autoheader)
|
|
|
|
AC_PATH_PROG(AS, as)
|
|
|
|
AC_PATH_PROG(RM, rm)
|
|
|
|
AC_PATH_PROG(CP, cp)
|
|
|
|
AC_PATH_PROG(MV, mv)
|
|
|
|
AC_PATH_PROG(LN, ln)
|
2022-06-14 03:27:38 +02:00
|
|
|
AC_PATH_PROG(LDGOLD, ld.gold)
|
|
|
|
AC_PATH_PROG(LDLLD, ld.lld)
|
2020-03-10 01:55:57 +01:00
|
|
|
AC_PATH_PROG(LD, ld.gold)
|
2022-03-27 04:00:22 +02:00
|
|
|
AC_PATH_PROG(XXD, xxd)
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_PATH_PROG(TOUCH, touch)
|
|
|
|
|
2020-07-09 01:53:03 +02:00
|
|
|
AC_SUBST(CFLAGS, "-pipe $CFLAGS")
|
|
|
|
AC_SUBST(CXXFLAGS, "-pipe $CXXFLAGS")
|
2022-06-14 23:31:04 +02:00
|
|
|
AC_SUBST(CCASFLAGS, "$CCASFLAGS")
|
2020-03-11 05:56:41 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
LT_INIT([dlopen shared disable-static])
|
|
|
|
LT_LANG([C++])
|
2016-07-01 05:04:00 +02:00
|
|
|
|
2019-10-06 09:14:22 +02:00
|
|
|
AM_PROG_AS
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_PROG_CXX
|
|
|
|
AC_PROG_CXX_C_O
|
2018-02-18 08:59:17 +01:00
|
|
|
AC_PROG_LIBTOOL
|
|
|
|
AC_PROG_MAKE_SET
|
2019-12-01 22:12:31 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_LANG(C++)
|
2022-06-18 04:27:28 +02:00
|
|
|
AX_CXX_COMPILE_STDCXX([20], [gnu], [optional], 202002)
|
|
|
|
AX_CXX_COMPILE_STDCXX([2a], [gnu], [mandatory], 201709)
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Makefile tree
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl These (and Makefile.in) are generated from a Makefile.am in the same dir.
|
|
|
|
dnl
|
2016-07-01 05:04:00 +02:00
|
|
|
|
|
|
|
AC_CONFIG_FILES(\
|
|
|
|
Makefile \
|
2016-08-15 04:44:16 +02:00
|
|
|
include/ircd/Makefile \
|
2018-02-22 22:33:53 +01:00
|
|
|
construct/Makefile \
|
2016-07-13 07:17:21 +02:00
|
|
|
ircd/Makefile \
|
2019-09-25 21:48:00 +02:00
|
|
|
matrix/Makefile \
|
2016-07-01 05:04:00 +02:00
|
|
|
modules/Makefile \
|
2018-09-14 05:59:52 +02:00
|
|
|
share/Makefile \
|
2016-07-01 05:04:00 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
AM_INIT_AUTOMAKE([subdir-objects])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-04-11 22:35:15 +02:00
|
|
|
dnl If this is not (un)set, paths are added such as -I../include/ircd to every
|
|
|
|
dnl build command and that isn't nice because it makes our headers conflict
|
|
|
|
dnl with standard library/path headers which we don't want or need.
|
|
|
|
AC_SUBST(DEFAULT_INCLUDES, [])
|
|
|
|
|
2019-12-01 22:12:31 +01:00
|
|
|
dnl
|
|
|
|
dnl Recursive local targets (clean-local is implied)
|
|
|
|
dnl
|
|
|
|
|
|
|
|
#AM_EXTRA_RECURSIVE_TARGETS([
|
|
|
|
# mrproper
|
|
|
|
#])
|
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
2018-06-02 19:25:50 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-02 19:25:50 +02:00
|
|
|
dnl Platform
|
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl
|
2019-12-01 22:10:38 +01:00
|
|
|
dnl Compiler brand
|
2018-06-02 19:25:50 +02:00
|
|
|
dnl
|
|
|
|
|
2019-12-01 22:10:38 +01:00
|
|
|
AM_CONDITIONAL([GCC], [[[[ $CXX = g\+\+* ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG], [[[[ $CXX = clang* ]]]])
|
2018-06-02 19:25:50 +02:00
|
|
|
RB_DEFINE_UNQUOTED([CXX], ["$CXX"], [CXX Compiler])
|
|
|
|
|
2019-12-01 22:10:38 +01:00
|
|
|
dnl
|
|
|
|
dnl Compiler version
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AX_CXX_VERSION
|
|
|
|
RB_DEFINE_UNQUOTED([CXX_VERSION], ["$CXX_VERSION"], [CXX Compiler Version])
|
|
|
|
|
|
|
|
AX_CXX_EPOCH
|
|
|
|
RB_DEFINE_UNQUOTED([CXX_EPOCH], [$CXX_EPOCH], [CXX Compiler Version (major nr)])
|
|
|
|
|
2020-09-15 02:17:13 +02:00
|
|
|
AM_CONDITIONAL([GCC8], [[[[ $CXX = g\+\+* ]] && [[ $CXX_EPOCH -ge 8 ]]]])
|
|
|
|
AM_CONDITIONAL([GCC9], [[[[ $CXX = g\+\+* ]] && [[ $CXX_EPOCH -ge 9 ]]]])
|
|
|
|
AM_CONDITIONAL([GCC10], [[[[ $CXX = g\+\+* ]] && [[ $CXX_EPOCH -ge 10 ]]]])
|
|
|
|
AM_CONDITIONAL([GCC11], [[[[ $CXX = g\+\+* ]] && [[ $CXX_EPOCH -ge 11 ]]]])
|
|
|
|
AM_CONDITIONAL([GCC12], [[[[ $CXX = g\+\+* ]] && [[ $CXX_EPOCH -ge 12 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG8], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 8 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG9], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 9 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG10], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 10 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG11], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 11 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG12], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 12 ]]]])
|
2021-12-23 01:08:01 +01:00
|
|
|
AM_CONDITIONAL([CLANG13], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 13 ]]]])
|
2022-03-10 19:58:45 +01:00
|
|
|
AM_CONDITIONAL([CLANG14], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 14 ]]]])
|
2020-09-15 02:17:13 +02:00
|
|
|
|
2018-06-02 19:25:50 +02:00
|
|
|
dnl
|
|
|
|
dnl Coarse operating system test macros
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_CONDITIONAL([LINUX], [[[[ $host_os = *linux* ]]]])
|
|
|
|
AM_CONDITIONAL([NETBSD], [[[[ $host_os = *netbsd* ]]]])
|
|
|
|
AM_CONDITIONAL([FREEBSD], [[[[ $host_os = *freebsd* ]]]])
|
|
|
|
AM_CONDITIONAL([MINGW], [[[[ $host_os = *mingw* ]] || [[ $host_os = *msys* ]]]])
|
|
|
|
AM_CONDITIONAL([CYGWIN], [[[[ $host_os = *cygwin* ]]]])
|
|
|
|
AM_CONDITIONAL([INTERIX], [[[[ $host_os = *interix* ]]]])
|
|
|
|
AM_CONDITIONAL([SOLARIS], [[[[ $host_os = *solaris* ]]]])
|
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([OS], ["$host_os"], [Host operating system])
|
|
|
|
|
2020-07-11 04:47:23 +02:00
|
|
|
dnl
|
|
|
|
dnl Standard libraries
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS([__dynamic_cast], [c++], [],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Please install libstdc++ on this system.])
|
|
|
|
])
|
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl Developer options
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Debugging mode
|
|
|
|
dnl
|
|
|
|
|
2018-05-18 02:37:04 +02:00
|
|
|
AC_MSG_CHECKING(whether to enable debugging)
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_ENABLE(debug, RB_HELP_STRING([--enable-debug], [Enable debugging suite for development]),
|
2016-07-20 20:55:46 +02:00
|
|
|
[
|
2019-09-26 05:30:26 +02:00
|
|
|
debug="yes"
|
2018-05-18 02:34:37 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_SUBST(DEBUG, 1)
|
|
|
|
RB_DEFINE_UNQUOTED([DEBUG], [1], [Not configured for release when lit.])
|
2017-10-05 01:32:12 +02:00
|
|
|
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [1], [Defined to 0 for release; or > 0 otherwise])
|
2016-07-20 20:55:46 +02:00
|
|
|
], [
|
2019-09-26 05:30:26 +02:00
|
|
|
debug="no"
|
2018-05-18 02:34:37 +02:00
|
|
|
AC_MSG_RESULT([no])
|
2017-10-05 01:32:12 +02:00
|
|
|
RB_DEFINE_UNQUOTED([DEBUG_LEVEL], [0], [Defined to 0 for release])
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
2017-09-12 18:54:10 +02:00
|
|
|
AM_CONDITIONAL([DEBUG], [[[[ "$DEBUG" = "1" ]]]])
|
|
|
|
|
2019-06-06 14:14:32 +02:00
|
|
|
dnl
|
|
|
|
dnl Compactness
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(Optimize for size; strip symbols; force no debugging)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(compact, RB_HELP_STRING([--enable-compact], [Optimize for size and compactness]),
|
2019-06-06 14:14:32 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_SUBST(COMPACT, 1)
|
|
|
|
RB_DEFINE_UNQUOTED([COMPACT], [1], [Not configured for compactness when lit.])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([COMPACT], [[[[ "$COMPACT" = "1" ]]]])
|
|
|
|
|
2018-05-22 01:56:20 +02:00
|
|
|
dnl
|
2018-05-16 21:36:31 +02:00
|
|
|
dnl Explicit assert switch for still using assert() without --enable-debug
|
2018-05-22 01:56:20 +02:00
|
|
|
dnl
|
2018-05-16 21:36:31 +02:00
|
|
|
|
2018-05-18 02:37:04 +02:00
|
|
|
AC_MSG_CHECKING(whether to explicitly enable assertions)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(assert, RB_HELP_STRING([--enable-assert], [Enable assertions without --enable-debug]),
|
2018-05-16 21:36:31 +02:00
|
|
|
[
|
2018-05-18 02:34:37 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
2018-05-16 21:36:31 +02:00
|
|
|
AC_SUBST(ASSERT, 1)
|
|
|
|
], [
|
2018-05-18 02:34:37 +02:00
|
|
|
AM_COND_IF(DEBUG,
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([no, but assertions are enabled anyway])
|
|
|
|
AC_SUBST(ASSERT, 1)
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
2018-05-16 21:36:31 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ASSERT], [[[[ "$ASSERT" = "1" ]]]])
|
|
|
|
|
|
|
|
AM_COND_IF(ASSERT,
|
|
|
|
[
|
2019-01-22 22:24:35 +01:00
|
|
|
assert="yes"
|
2020-04-14 07:07:04 +02:00
|
|
|
assert_type="abort"
|
2018-05-16 21:36:31 +02:00
|
|
|
], [
|
2019-01-22 22:24:35 +01:00
|
|
|
assert="no"
|
2018-05-16 21:36:31 +02:00
|
|
|
CPPDEFINE([NDEBUG])
|
|
|
|
])
|
|
|
|
|
2019-03-15 21:01:26 +01:00
|
|
|
dnl
|
|
|
|
dnl Switch to control the action of assert()
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to change the behavior of assertions)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_WITH(assert, RB_HELP_STRING([--with-assert[[[=abort]]]], [Soften assertion behavior]),
|
2019-03-15 21:01:26 +01:00
|
|
|
[
|
|
|
|
assert_type=$withval
|
2020-04-11 22:35:15 +02:00
|
|
|
AC_MSG_RESULT([yes, "$assert_type"])
|
2019-03-15 21:01:26 +01:00
|
|
|
AC_SUBST(ASSERT_TYPE, $assert_type)
|
|
|
|
], [
|
2020-04-11 22:35:15 +02:00
|
|
|
AC_MSG_RESULT([no])
|
2019-03-15 21:01:26 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF(ASSERT,
|
|
|
|
[
|
|
|
|
if [[ ! -z "$assert_type" ]]; then
|
2019-08-12 04:02:50 +02:00
|
|
|
|
2020-04-11 22:35:15 +02:00
|
|
|
if [[ "$assert_type" != "abort" ]]; then
|
|
|
|
RB_DEFINE_UNQUOTED([ASSERT], ["$assert_type"], [Assertion behavior])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [[ "$assert_type" == "trap" ]]; then
|
|
|
|
RB_DEFINE([ASSERT_INTRINSIC], [1], [Intrinsic assertion behavior])
|
|
|
|
fi
|
|
|
|
|
2019-08-12 04:02:50 +02:00
|
|
|
fi
|
2019-03-15 21:01:26 +01:00
|
|
|
])
|
|
|
|
|
2018-05-22 01:56:20 +02:00
|
|
|
dnl
|
2018-05-16 21:36:31 +02:00
|
|
|
dnl Explicit optimize switch for enabling optimization when using --enable-debug
|
2018-05-22 01:56:20 +02:00
|
|
|
dnl
|
2018-05-16 21:36:31 +02:00
|
|
|
|
2018-05-18 02:37:04 +02:00
|
|
|
AC_MSG_CHECKING(whether to explicitly enable optimized build)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(optimize, RB_HELP_STRING([--enable-optimize], [Enable optimization even with --enable-debug]),
|
2018-05-16 21:36:31 +02:00
|
|
|
[
|
2018-05-18 02:34:37 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
2018-05-16 21:36:31 +02:00
|
|
|
AC_SUBST(OPTIMIZE, 1)
|
|
|
|
], [
|
2018-05-18 02:34:37 +02:00
|
|
|
AM_COND_IF(DEBUG,
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no, but optimized build is enabled anyway])
|
|
|
|
AC_SUBST(OPTIMIZE, 1)
|
|
|
|
])
|
2018-05-16 21:36:31 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([OPTIMIZE], [[[[ "$OPTIMIZE" = "1" ]]]])
|
|
|
|
|
2019-01-22 22:13:36 +01:00
|
|
|
dnl
|
|
|
|
dnl Explicit link-time-optimization switch
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable link-time optimization)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(lto, RB_HELP_STRING([--disable-lto], [Enable link-time optimization]),
|
2019-01-22 22:13:36 +01:00
|
|
|
[
|
2021-01-16 02:15:49 +01:00
|
|
|
lto=$enableval
|
2019-01-22 22:13:36 +01:00
|
|
|
], [
|
2021-01-16 02:15:49 +01:00
|
|
|
lto="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
if test "$lto" = "yes"; then
|
2020-04-18 06:21:28 +02:00
|
|
|
AM_COND_IF(OPTIMIZE,
|
2019-01-22 22:13:36 +01:00
|
|
|
[
|
2020-04-18 06:21:28 +02:00
|
|
|
AM_COND_IF(CLANG,
|
|
|
|
[
|
2020-10-02 05:57:03 +02:00
|
|
|
AS_CASE([$host_cpu],
|
|
|
|
[aarch64],
|
|
|
|
[
|
|
|
|
lto="no"
|
|
|
|
AC_MSG_RESULT([no, doesn't work on aarch64])
|
|
|
|
], [
|
|
|
|
lto="yes"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_SUBST(LTO, 1)
|
|
|
|
])
|
2020-04-18 06:21:28 +02:00
|
|
|
], [
|
|
|
|
lto="no"
|
|
|
|
AC_MSG_RESULT([no, only available with clang])
|
|
|
|
])
|
2019-01-22 22:13:36 +01:00
|
|
|
], [
|
2020-04-18 06:21:28 +02:00
|
|
|
lto="no"
|
|
|
|
AC_MSG_RESULT([no, optimizations disabled])
|
2019-01-22 22:13:36 +01:00
|
|
|
])
|
2022-04-10 20:16:47 +02:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
2021-01-16 02:15:49 +01:00
|
|
|
fi
|
2019-01-22 22:13:36 +01:00
|
|
|
|
|
|
|
AM_CONDITIONAL([LTO], [[[[ "$LTO" = "1" ]]]])
|
|
|
|
|
2018-05-28 11:45:34 +02:00
|
|
|
dnl
|
|
|
|
dnl Explicit optimization level switch
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to explicitly set the optimization level)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_WITH(optimize-level, RB_HELP_STRING([--with-optimize-level[[[=3]]]], [Explicitly set the optimize level]),
|
2018-05-28 11:45:34 +02:00
|
|
|
[
|
|
|
|
optimize_level=$withval
|
|
|
|
AC_MSG_RESULT([yes, enabling optimization level -O$optimize_level])
|
|
|
|
AC_SUBST(OPTMIZE_LEVEL, $optimize_level)
|
|
|
|
RB_DEFINE_UNQUOTED([OPTIMIZE_LEVEL], [$optimize_level], [User configured optimization level])
|
|
|
|
], [
|
|
|
|
AM_COND_IF(OPTIMIZE,
|
|
|
|
[
|
2019-06-06 14:14:32 +02:00
|
|
|
AM_COND_IF(COMPACT,
|
|
|
|
[
|
|
|
|
optimize_level="s"
|
|
|
|
AC_MSG_RESULT([no, but --enable-optimize and --enable-compact means -O$optimize_level])
|
|
|
|
AC_SUBST(OPTIMIZE_LEVEL, $optimize_level)
|
|
|
|
RB_DEFINE_UNQUOTED([OPTIMIZE_LEVEL], [$optimize_level], [Implicitly set release mode optimization])
|
|
|
|
], [
|
|
|
|
optimize_level="3"
|
|
|
|
AC_MSG_RESULT([no, but --enable-optimize has implied level -O$optimize_level])
|
|
|
|
AC_SUBST(OPTIMIZE_LEVEL, $optimize_level)
|
|
|
|
RB_DEFINE_UNQUOTED([OPTIMIZE_LEVEL], [$optimize_level], [Explicitly set release mode optimization])
|
|
|
|
])
|
2018-05-28 11:45:34 +02:00
|
|
|
], [
|
|
|
|
AM_COND_IF(DEBUG,
|
|
|
|
[
|
|
|
|
optimize_level="g"
|
|
|
|
AC_MSG_RESULT([no, but --enable-debug has implied level -O$optimize_level])
|
|
|
|
AC_SUBST(OPTIMIZE_LEVEL, $optimize_level)
|
2018-12-22 02:19:37 +01:00
|
|
|
RB_DEFINE_UNQUOTED([OPTIMIZE_LEVEL], ['$optimize_level'], [Debug mode optimization level])
|
2018-05-28 11:45:34 +02:00
|
|
|
], [
|
|
|
|
optimize_level="3"
|
|
|
|
AC_MSG_RESULT([no, but release mode has implied level -O$optimize_level])
|
|
|
|
AC_SUBST(OPTIMIZE_LEVEL, $optimize_level)
|
|
|
|
RB_DEFINE_UNQUOTED([OPTIMIZE_LEVEL], [$optimize_level], [Release mode optimization])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2018-05-22 01:55:10 +02:00
|
|
|
dnl
|
|
|
|
dnl Explicit log level
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl NOTE: Log levels here must be manually sync'ed with ircd/logger.h
|
|
|
|
dnl
|
2018-05-22 01:55:10 +02:00
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to explicitly set the logging level ceiling)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_WITH(log-level, RB_HELP_STRING([--with-log-level[[[=INFO]]]], [Explicitly set the log level ceiling]),
|
2018-05-22 01:55:10 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes, enabling log level $withval and below])
|
|
|
|
|
|
|
|
level=4
|
|
|
|
if [[ $withval = "DEBUG" ]]; then
|
|
|
|
level=7
|
|
|
|
elif [[ $withval = "DWARNING" ]]; then
|
|
|
|
level=6
|
|
|
|
elif [[ $withval = "DERROR" ]]; then
|
|
|
|
level=5
|
|
|
|
elif [[ $withval = "INFO" ]]; then
|
|
|
|
level=4
|
|
|
|
elif [[ $withval = "NOTICE" ]]; then
|
|
|
|
level=3
|
|
|
|
elif [[ $withval = "WARNING" ]]; then
|
|
|
|
level=2
|
|
|
|
elif [[ $withval = "ERROR" ]]; then
|
|
|
|
level=1
|
|
|
|
elif [[ $withval = "CRITICAL" ]]; then
|
|
|
|
level=0
|
|
|
|
elif [[ $withval = "-1" ]]; then
|
|
|
|
level=-1
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_SUBST(LOG_LEVEL, $level)
|
|
|
|
RB_DEFINE_UNQUOTED([LOG_LEVEL], [$level], [Log messages for user configured level and below.])
|
|
|
|
], [
|
|
|
|
AM_COND_IF(DEBUG,
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([no, but debug mode enables all log levels through DEBUG])
|
|
|
|
AC_SUBST(LOG_LEVEL, 7)
|
|
|
|
RB_DEFINE_UNQUOTED([LOG_LEVEL], [7], [Log message level default for DEBUG mode])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_SUBST(LOG_LEVEL, 4)
|
|
|
|
RB_DEFINE_UNQUOTED([LOG_LEVEL], [4], [Log message level default for release mode])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Profiling mode
|
|
|
|
dnl
|
|
|
|
|
2020-11-24 20:04:19 +01:00
|
|
|
AC_MSG_CHECKING(whether to instrument build for runtime profile generation)
|
|
|
|
AC_ARG_ENABLE(profile, RB_HELP_STRING([--enable-profile], [Generate profile at runtime]),
|
2016-07-20 20:55:46 +02:00
|
|
|
[
|
2020-04-17 05:28:10 +02:00
|
|
|
profiling="yes"
|
2020-11-24 20:04:19 +01:00
|
|
|
AC_DEFINE(CHARYBDIS_PROFILE, 1, [Define this if you are profiling.])
|
|
|
|
|
2020-04-17 05:28:10 +02:00
|
|
|
AM_COND_IF(GCC,
|
|
|
|
[
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_RESULT([yes, adding -pg])
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-pg"])
|
2020-04-17 05:28:10 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF(CLANG,
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes, adding profiling flags])
|
2020-11-24 20:04:19 +01:00
|
|
|
|
|
|
|
#RB_VAR_PREPEND([CXXFLAGS], ["-fprofile-generate"])
|
|
|
|
#RB_VAR_PREPEND([LDFLAGS], ["-Wl,-fprofile-generate"])
|
|
|
|
|
|
|
|
dnl TODO: $enableval=instr?
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fprofile-instr-generate"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fcoverage-mapping"])
|
|
|
|
dnl RB_VAR_PREPEND([LDFLAGS], ["-Wl,-fprofile-instr-generate"])
|
2020-04-17 05:28:10 +02:00
|
|
|
])
|
2020-11-24 20:04:19 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
], [
|
2020-04-17 05:28:10 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
profiling="no"
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
2020-11-24 20:04:19 +01:00
|
|
|
AC_MSG_CHECKING(whether to use a specific runtime profile)
|
|
|
|
AC_ARG_WITH(profile, RB_HELP_STRING([--with-profile[[[=$PWD]]]], [Path to profdata]),
|
|
|
|
[
|
|
|
|
profiling_use=$withval
|
|
|
|
AC_MSG_RESULT([yes, "$profiling_use"])
|
|
|
|
AC_SUBST(PROFILE_USE, $profiling_use)
|
|
|
|
|
|
|
|
dnl AM_COND_IF(CLANG,
|
|
|
|
dnl [
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], [-fprofile-use="$profiling_use"])
|
|
|
|
dnl ])
|
|
|
|
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([PROFILE], [[[[ "$profiling" = "yes" ]]]])
|
|
|
|
|
2020-11-28 21:24:23 +01:00
|
|
|
dnl Provide the correct target to the Makefiles
|
2022-03-10 19:58:45 +01:00
|
|
|
AM_COND_IF(CLANG14, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-14) ])
|
2021-12-23 01:08:01 +01:00
|
|
|
AM_COND_IF(CLANG13, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-13) ])
|
2020-11-28 21:24:23 +01:00
|
|
|
AM_COND_IF(CLANG12, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-12) ])
|
2021-09-04 01:28:39 +02:00
|
|
|
AM_COND_IF(CLANG11, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-11) ])
|
|
|
|
AM_COND_IF(CLANG10, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-10) ])
|
|
|
|
AM_COND_IF(CLANG9, [ AC_PATH_PROG(LLVM_PROFDATA, llvm-profdata-9) ])
|
2020-11-28 21:24:23 +01:00
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Precompiled headers
|
|
|
|
dnl
|
|
|
|
|
2021-01-16 02:15:49 +01:00
|
|
|
AC_MSG_CHECKING(whether to enable precompiled headers)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(pch, RB_HELP_STRING([--disable-pch], [Disable precompiled header generation]),
|
2016-07-24 03:42:24 +02:00
|
|
|
[
|
2021-01-16 02:15:49 +01:00
|
|
|
build_pch=$enableval
|
|
|
|
AC_MSG_RESULT([$enableval])
|
2016-07-24 03:42:24 +02:00
|
|
|
], [
|
|
|
|
build_pch="yes"
|
2016-08-13 04:41:59 +02:00
|
|
|
CPPDEFINE([PCH])
|
2016-07-24 03:42:24 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([BUILD_PCH], [[[[ "$build_pch" = "yes" ]]]])
|
|
|
|
|
2018-07-06 08:52:29 +02:00
|
|
|
dnl
|
|
|
|
dnl Generic Mode compilation
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable generic mode or tune for this host)
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_ENABLE(generic, RB_HELP_STRING([--enable-generic], [Emit more generic code for pkg binaries]),
|
2018-07-06 08:52:29 +02:00
|
|
|
[
|
|
|
|
enable_generic="yes"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
RB_DEFINE([GENERIC], [1], [Building binary tuned for generic architectures])
|
|
|
|
], [
|
|
|
|
enable_generic="no"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([GENERIC], [[[[ "$enable_generic" = "yes" ]]]])
|
|
|
|
|
2019-04-12 21:01:13 +02:00
|
|
|
dnl
|
|
|
|
dnl Untuned Mode compilation
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable fully untuned mode)
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_ENABLE(untuned, RB_HELP_STRING([--enable-untuned], [Emit no special feature instructions]),
|
2019-04-12 21:01:13 +02:00
|
|
|
[
|
|
|
|
enable_untuned="yes"
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
RB_DEFINE([UNTUNED], [1], [Building binary without extended-feature cpu instructions.])
|
|
|
|
], [
|
|
|
|
enable_untuned="no"
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([UNTUNED], [[[[ "$enable_untuned" = "yes" ]]]])
|
|
|
|
|
2019-07-03 23:31:05 +02:00
|
|
|
dnl
|
|
|
|
dnl Disable third-party allocators
|
|
|
|
dnl
|
|
|
|
|
2021-01-16 02:15:49 +01:00
|
|
|
AC_MSG_CHECKING(whether to allow available third-party allocator libraries from being used)
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(malloc-libs, RB_HELP_STRING([--disable-malloc-libs], [Disable third-party dynamic memory libraries (jemalloc/tcmalloc/etc)]),
|
2019-07-03 23:31:05 +02:00
|
|
|
[
|
2021-01-16 02:15:49 +01:00
|
|
|
use_malloc_libs=$enableval
|
|
|
|
AC_MSG_RESULT([$enableval])
|
2019-07-03 23:31:05 +02:00
|
|
|
], [
|
2019-07-04 06:41:48 +02:00
|
|
|
use_malloc_libs="yes"
|
2021-01-16 02:15:49 +01:00
|
|
|
AC_MSG_RESULT([yes])
|
2019-07-03 23:31:05 +02:00
|
|
|
])
|
|
|
|
|
2019-07-04 06:41:48 +02:00
|
|
|
AM_CONDITIONAL([MALLOC_LIBS], [[[[ "$use_malloc_libs" = "yes" ]]]])
|
2019-07-03 23:31:05 +02:00
|
|
|
|
2019-03-23 01:46:21 +01:00
|
|
|
dnl
|
|
|
|
dnl Low memory compilation mode
|
|
|
|
dnl
|
|
|
|
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(lowmem-compile, RB_HELP_STRING([--enable-lowmem-compile], [Enable low-memory compilation options]),
|
2019-03-23 01:46:21 +01:00
|
|
|
[
|
|
|
|
lowmem_compile="yes"
|
|
|
|
], [
|
|
|
|
lowmem_compile="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([LOWMEM_COMPILE], [[[[ $lowmem_compile = "yes" ]]]])
|
2018-11-13 03:50:09 +01:00
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
|
|
|
dnl
|
2022-06-13 21:57:21 +02:00
|
|
|
dnl Compiler flags
|
2020-07-30 15:23:31 +02:00
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Reserved for user
|
|
|
|
dnl
|
|
|
|
dnl ex. `make EXTRA_CXXFLAGS="-Weverything" ircd` to append CXXFLAGS
|
|
|
|
|
|
|
|
dnl AC_SUBST(EXTRA_CPPFLAGS, "$EXTRA_CPPFLAGS")
|
|
|
|
dnl AC_SUBST(EXTRA_CFLAGS, "$EXTRA_CFLAGS")
|
|
|
|
dnl AC_SUBST(EXTRA_CXXFLAGS, "$EXTRA_CXXFLAGS")
|
|
|
|
dnl AC_SUBST(EXTRA_LDFLAGS, "$EXTRA_LDFLAGS")
|
|
|
|
dnl AC_SUBST(EXTRA_LIBS, "$EXTRA_LIBS")
|
|
|
|
|
2019-09-25 21:48:00 +02:00
|
|
|
dnl
|
2021-11-11 04:52:13 +01:00
|
|
|
dnl Features
|
2019-09-25 21:48:00 +02:00
|
|
|
dnl
|
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fmodules-ts"])
|
|
|
|
])
|
2019-09-25 21:48:00 +02:00
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fmodules"])
|
|
|
|
])
|
2019-09-25 21:48:00 +02:00
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([CLANG],
|
2019-09-25 21:48:00 +02:00
|
|
|
[
|
2021-11-11 04:52:13 +01:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fblocks"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fasm-blocks"])
|
|
|
|
])
|
2019-09-25 21:48:00 +02:00
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([CLANG11],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fenable-matrix"])
|
|
|
|
])
|
2019-09-25 21:48:00 +02:00
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
dnl
|
|
|
|
dnl Misc
|
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl This disables thread-safety for static variable initialization
|
|
|
|
dnl (specifically local static variables inside functions) which reduces
|
|
|
|
dnl generated code size and complexity. This is alright since construct is
|
|
|
|
dnl primarily single threaded. Even if other threads are spawned for special
|
|
|
|
dnl tasks we consider the likelyhood of a static initialization race to either
|
|
|
|
dnl be sufficiently low or simply immaterial for our uses of them.
|
|
|
|
dnl
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fno-threadsafe-statics"])
|
|
|
|
|
|
|
|
dnl Exception safety at instruction boundary rather than function boundary
|
|
|
|
dnl This option is needed to enable noexcept(false) i.e to throw from a
|
|
|
|
dnl destructor; without this noexcept(false) still terminates.
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fasynchronous-unwind-tables"])
|
|
|
|
|
|
|
|
dnl -fvisibility-inlines-hidden - for optimization; note the address of inline
|
|
|
|
dnl functions won't be the same between translation units
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fvisibility-inlines-hidden"])
|
|
|
|
|
|
|
|
dnl see gcc(1)
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fnothrow-opt"])
|
2019-09-25 21:48:00 +02:00
|
|
|
])
|
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([GCC],
|
2020-07-30 15:23:31 +02:00
|
|
|
[
|
2021-11-11 04:52:13 +01:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-flax-vector-conversions"])
|
2020-07-30 15:23:31 +02:00
|
|
|
])
|
|
|
|
|
2018-02-18 08:59:17 +01:00
|
|
|
dnl
|
|
|
|
dnl Optimization
|
|
|
|
dnl
|
|
|
|
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-O$optimize_level"])
|
2018-12-30 23:33:59 +01:00
|
|
|
|
2018-05-16 21:36:31 +02:00
|
|
|
AM_COND_IF([OPTIMIZE],
|
2018-02-18 08:59:17 +01:00
|
|
|
[
|
2019-01-22 22:24:35 +01:00
|
|
|
optimize="yes"
|
2019-07-20 01:22:18 +02:00
|
|
|
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fgcse-sm"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fgcse-las"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fsched-stalled-insns=0"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fsched-pressure"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fsched-spec-load"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fsched2-use-superblocks"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fsched2-use-superblocks"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fira-hoist-pressure"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fbranch-target-load-optimize"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-frerun-loop-opt"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fdevirtualize-at-ltrans"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fbtr-bb-exclusive"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fipa-pta"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fmodulo-sched"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fmodulo-sched-allow-regmoves"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftracer"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-loop-im"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-switch-conversion"])
|
2019-07-20 01:22:18 +02:00
|
|
|
])
|
2018-05-16 21:36:31 +02:00
|
|
|
], [
|
2019-01-22 22:24:35 +01:00
|
|
|
optimize="no"
|
2019-12-01 03:55:24 +01:00
|
|
|
|
|
|
|
dnl Optimization options we enable in non-optimized mode. These will be enabled
|
|
|
|
dnl in non-optimized mode as well as optimized mode so they are as similar as
|
|
|
|
dnl possible without impacting debuggability.
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-falign-functions"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-fdata-sections"])
|
|
|
|
dnl RB_VAR_PREPEND([CXXFLAGS], ["-ffunction-sections"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-vectorize"])
|
2019-12-01 03:55:24 +01:00
|
|
|
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-falign-labels"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-falign-loops"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-falign-jumps"])
|
|
|
|
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-vrp"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-dce"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-dse"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-loop-im"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ftree-switch-conversion"])
|
2019-12-01 03:55:24 +01:00
|
|
|
])
|
2018-02-18 08:59:17 +01:00
|
|
|
])
|
|
|
|
|
2020-02-12 00:21:50 +01:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fno-data-sections"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fno-function-sections"])
|
2020-02-12 00:21:50 +01:00
|
|
|
])
|
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Compiler intrumentation
|
|
|
|
dnl
|
|
|
|
|
2022-03-10 19:58:45 +01:00
|
|
|
dnl XXX workaround for valgrind; remove once valgrind is updated
|
2019-05-17 03:36:15 +02:00
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
2022-03-10 19:58:45 +01:00
|
|
|
AM_COND_IF([CLANG14],
|
2019-06-21 11:26:00 +02:00
|
|
|
[
|
2022-03-10 19:58:45 +01:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-gdwarf-4"])
|
2019-06-21 11:26:00 +02:00
|
|
|
])
|
2022-03-10 19:58:45 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl Enable debugging symbols.
|
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ggdb"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-g"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fvar-tracking-assignments"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fvar-tracking"])
|
2019-06-06 14:14:32 +02:00
|
|
|
])
|
2019-05-17 03:36:15 +02:00
|
|
|
])
|
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fverbose-asm"])
|
|
|
|
|
2018-11-13 03:25:45 +01:00
|
|
|
dnl Creates an ELF section in the output which contains a list of
|
|
|
|
dnl the command line arguments used for compilation.
|
2019-06-21 11:26:00 +02:00
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-frecord-gcc-switches"])
|
2019-06-21 11:26:00 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-grecord-gcc-switches"])
|
2021-11-11 04:52:13 +01:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fno-discard-value-names"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fident"])
|
2019-06-21 11:26:00 +02:00
|
|
|
])
|
2018-11-13 03:25:45 +01:00
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fmax-errors=2"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-ferror-limit=2"])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Runtime intrumentation
|
|
|
|
dnl
|
|
|
|
|
2019-06-21 11:26:00 +02:00
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fstack-protector-explicit"])
|
2019-12-01 04:31:07 +01:00
|
|
|
|
|
|
|
dnl These flags should not be used on Intel-CET capable platforms
|
|
|
|
dnl TODO: XXX
|
|
|
|
AS_IF([test "$CXX_EPOCH" -ge "9"],
|
|
|
|
[
|
|
|
|
AM_COND_IF([GENERIC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fcf-protection=full"])
|
2019-12-01 04:31:07 +01:00
|
|
|
], [
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fcf-protection=none"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-mmanual-endbr"])
|
2019-12-01 04:31:07 +01:00
|
|
|
])
|
|
|
|
])
|
2019-06-21 11:26:00 +02:00
|
|
|
])
|
2017-09-30 08:00:16 +02:00
|
|
|
|
2019-10-09 04:45:18 +02:00
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fvtable-verify=none"])
|
2019-10-09 04:45:18 +02:00
|
|
|
])
|
|
|
|
|
2020-07-12 20:48:48 +02:00
|
|
|
dnl
|
|
|
|
dnl Machine Tuning
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_COND_IF([UNTUNED],
|
|
|
|
[
|
|
|
|
machine_tuning="generic ${host_cpu} and untuned"
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-mno-default"])
|
|
|
|
], [
|
|
|
|
AM_COND_IF([GENERIC],
|
|
|
|
[
|
|
|
|
machine_tuning="generic ${host_cpu} instruction set"
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-mtune=generic"])
|
|
|
|
], [
|
|
|
|
machine_tuning="${host_cpu} native instruction set"
|
|
|
|
|
|
|
|
AS_CASE([$host_cpu],
|
|
|
|
[x86_64],
|
|
|
|
[
|
2020-10-02 01:25:23 +02:00
|
|
|
dnl AMD K10's SSE4a doesn't work with valgrind
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-mno-sse4a"])
|
2020-10-02 04:50:06 +02:00
|
|
|
|
|
|
|
dnl Not accepted by clang on aarch64
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-march=native"])
|
2020-07-12 20:48:48 +02:00
|
|
|
])
|
2020-10-02 04:50:06 +02:00
|
|
|
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-mtune=native"])
|
2020-07-12 20:48:48 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Compiler warnings
|
|
|
|
dnl
|
|
|
|
|
2017-09-23 02:24:36 +02:00
|
|
|
STACK_USAGE_WARNING=16384
|
2017-10-05 01:37:07 +02:00
|
|
|
FRAME_SIZE_WARNING=8192
|
2016-07-20 20:55:46 +02:00
|
|
|
CWARNS=""
|
2017-10-25 18:11:21 +02:00
|
|
|
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wall], charybdis_cv_c_gcc_w_all)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wextra], charybdis_cv_c_gcc_w_extra)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wpointer-arith], charybdis_cv_c_gcc_w_pointer_arith)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wcast-align], charybdis_cv_c_gcc_w_cast_align)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wcast-qual], charybdis_cv_c_gcc_w_cast_qual)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wfloat-equal], charybdis_cv_c_gcc_w_float_equal)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wwrite-strings], charybdis_cv_c_gcc_w_write_strings)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wparentheses], charybdis_cv_c_gcc_parentheses)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wundef], charybdis_cv_c_gcc_w_undef)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wpacked], charybdis_cv_c_gcc_w_packed)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wformat -Wformat-y2k -Wformat-nonliteral], charybdis_cv_c_gcc_w_format)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wstrict-aliasing=2 -Wstrict-overflow=5], charybdis_cv_c_gcc_w_strict)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wdisabled-optimization], charybdis_cv_c_gcc_w_disabled_optimization)
|
|
|
|
RB_MAYBE_CXXFLAG([-Winvalid-pch], charybdis_cv_c_gcc_w_invalid_pch)
|
|
|
|
RB_MAYBE_CXXFLAG([-Winit-self], charybdis_cv_c_gcc_w_init_self)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wuninitialized], charybdis_cv_c_gcc_w_uninitialized)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wunreachable-code], charybdis_cv_c_gcc_w_unreachable_code)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-overloaded-virtual], charybdis_cv_c_gcc_w_overloaded_virtual)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wnon-virtual-dtor], charybdis_cv_c_gcc_w_non_virtual_dtor)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wnoexcept], charybdis_cv_c_gcc_w_noexcept)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsized-deallocation], charybdis_cv_c_gcc_w_sized_deallocation)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wctor-dtor-privacy], charybdis_cv_c_gcc_w_ctor_dtor_privacy)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsign-promo], charybdis_cv_c_gcc_w_sign_promo)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wtrampolines], charybdis_cv_c_gcc_w_trampolines)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wduplicated-cond], charybdis_cv_c_gcc_w_duplicated_cond)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wduplicate-branches], charybdis_cv_c_gcc_w_duplicate_branches)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wrestrict], charybdis_cv_c_gcc_w_restrict)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wnull-dereference], charybdis_cv_c_gcc_w_null_dereference)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wplacement-new=2], charybdis_cv_c_gcc_w_placement_new)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wundef], charybdis_cv_c_gcc_w_undef)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wodr], charybdis_cv_c_gcc_w_odr)
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2019-02-16 21:33:30 +01:00
|
|
|
dnl
|
|
|
|
dnl List of warnings treated as errors
|
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl Uninitialized return values are not useful in this project; forgetting
|
|
|
|
dnl to return from a function is always a developer mistake here.
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Werror=return-type], charybdis_cv_c_gcc_w_error_return_type)
|
2019-02-16 21:33:30 +01:00
|
|
|
|
2017-10-25 18:11:21 +02:00
|
|
|
dnl
|
|
|
|
dnl List of warnings we suppress:
|
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl Missing field initializers should have default init or some zero-extension as per std, this
|
|
|
|
dnl warning is only useful if you want to gauge where that's happening for a specific reason
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-missing-field-initializers], charybdis_cv_c_gcc_w_missing_field_initializers)
|
2017-10-25 18:11:21 +02:00
|
|
|
|
|
|
|
dnl Unused variables, functions, labels, etc are just fine as long as they get optimized
|
|
|
|
dnl away. These warnings can be re-enabled during a code cleanup, otherwise shut up.
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused], charybdis_cv_c_gcc_w_unused)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-function], charybdis_cv_c_gcc_w_unused_function)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-label], charybdis_cv_c_gcc_w_unused_label)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-value], charybdis_cv_c_gcc_w_unused_value)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-variable], charybdis_cv_c_gcc_w_unused_variable)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-parameter], charybdis_cv_c_gcc_w_unused_parameter)
|
2017-10-25 18:11:21 +02:00
|
|
|
|
2019-05-28 12:46:18 +02:00
|
|
|
dnl This warning is disabled to allow preprocessor statements like #endif to
|
|
|
|
dnl contain text on the same line. This is used for example to write the
|
|
|
|
dnl identifier in the matching prior #ifdef, which has no actual effect except
|
|
|
|
dnl clarity.
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-endif-labels], charybdis_cv_c_gcc_w_endif_labels)
|
2019-05-28 12:46:18 +02:00
|
|
|
|
2019-12-01 23:42:30 +01:00
|
|
|
dnl
|
|
|
|
dnl Suppressed unless in debug mode
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-final-types], charybdis_cv_c_gcc_w_suggest_final_types)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-final-methods], charybdis_cv_c_gcc_w_suggest_final_methods)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-override], charybdis_cv_c_gcc_w_suggest_override)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wmissing-noreturn], charybdis_cv_c_gcc_w_missing_noreturn)
|
2020-07-25 17:28:42 +02:00
|
|
|
], [
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unknown-pragmas], charybdis_cv_c_gcc_w_unknown_pragmas)
|
2020-11-28 04:52:22 +01:00
|
|
|
|
2020-08-09 17:19:18 +02:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unknown-attributes], charybdis_cv_c_gcc_w_unknown_attributes)
|
2020-08-09 17:19:18 +02:00
|
|
|
])
|
2020-11-28 04:52:22 +01:00
|
|
|
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-ignored-attributes], charybdis_cv_c_gcc_w_ignored_attributes)
|
2020-11-28 04:52:22 +01:00
|
|
|
])
|
2019-12-01 23:42:30 +01:00
|
|
|
])
|
|
|
|
|
2017-10-25 18:11:21 +02:00
|
|
|
dnl
|
|
|
|
dnl List of compiler-specific / incompatible warning options
|
|
|
|
dnl
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wlogical-op], charybdis_cv_c_gcc_w_logical_op)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wformat-security], charybdis_cv_c_gcc_w_format_security)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wstack-usage=$STACK_USAGE_WARNING], charybdis_cv_c_gcc_w_stack_usage)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wframe-larger-than=$FRAME_SIZE_WARNING], charybdis_cv_c_gcc_w_frame_larger_than)
|
|
|
|
RB_MAYBE_CXXFLAG([-Walloca], charybdis_cv_c_gcc_w_alloca)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wvector-operation-performance], charybdis_cv_c_gcc_w_vector_operation_performance)
|
2019-08-06 00:09:28 +02:00
|
|
|
|
2019-12-01 23:42:30 +01:00
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-attribute=format], charybdis_cv_c_gcc_w_suggest_attribute_format)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-attribute=noreturn], charybdis_cv_c_gcc_w_suggest_attribute_noreturn)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-attribute=malloc], charybdis_cv_c_gcc_w_suggest_attribute_malloc)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wsuggest-attribute=cold], charybdis_cv_c_gcc_w_suggest_attribute_cold)
|
|
|
|
dnl RB_MAYBE_CXXFLAG([-Wsuggest-attribute=pure], charybdis_cv_c_gcc_w_suggest_attribute_pure)
|
|
|
|
dnl RB_MAYBE_CXXFLAG([-Wsuggest-attribute=const], charybdis_cv_c_gcc_w_suggest_attribute_const)
|
2019-12-01 23:42:30 +01:00
|
|
|
])
|
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2016-08-16 05:53:43 +02:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2022-06-14 03:00:27 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wundefined-reinterpret-cast], charybdis_cv_c_gcc_w_undefined_reinterpret_cast)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wconditional-uninitialized], charybdis_cv_c_gcc_w_conditional_uninitialized)
|
|
|
|
|
2022-06-13 21:57:21 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-mismatched-tags], charybdis_cv_c_gcc_w_mismatched_tags)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-format-security], charybdis_cv_c_gcc_w_format_security)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unknown-warning-option], charybdis_cv_c_gcc_w_unknown_warning_option)
|
2022-06-14 23:53:12 +02:00
|
|
|
RB_MAYBE_CXXFLAG([-Wno-profile-instr-unprofiled], charybdis_cv_c_gcc_w_profile_instr_unprofiled)
|
2019-12-01 23:42:30 +01:00
|
|
|
])
|
2016-08-16 05:53:43 +02:00
|
|
|
|
2022-06-14 03:00:27 +02:00
|
|
|
dnl Warning discovery section
|
|
|
|
AC_MSG_CHECKING(whether to enable warning discovery)
|
|
|
|
AC_ARG_ENABLE(every-warning,
|
|
|
|
RB_HELP_STRING([--enable-every-warning], [Enable warning discovery (-Weverything)]),
|
|
|
|
[
|
|
|
|
RB_MAYBE_CXXFLAG([-Weverything], charybdis_cv_c_gcc_w_everything)
|
|
|
|
|
|
|
|
dnl Ignored a priori
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-c++98-compat], charybdis_cv_c_gcc_w_no_cxx98_compat)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-c++98-compat-pedantic], charybdis_cv_c_gcc_w_no_cxx98_compat_pedantic)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-c++98-compat-extra-semi], charybdis_cv_c_gcc_w_no_cxx98_compat_extra_semi)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-pre-c++14-compat], charybdis_cv_c_gcc_w_no_pre_cxx14_compat)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-pre-c++17-compat], charybdis_cv_c_gcc_w_no_pre_cxx17_compat)
|
|
|
|
|
|
|
|
dnl Ignored by design
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-comma], charybdis_cv_c_gcc_w_no_comma)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-shadow], charybdis_cv_c_gcc_w_no_shadow)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-shadow-field], charybdis_cv_c_gcc_w_no_shadow_field)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-shadow-field-in-constructor], charybdis_cv_c_gcc_w_no_shadow_field_in_constructor)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-shadow-uncaptured-local], charybdis_cv_c_gcc_w_no_shadow_uncaptured_local)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-gnu-conditional-omitted-operand], charybdis_cv_c_gcc_w_no_gnu_conditional_omitted_operand)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-ctad-maybe-unsupported], charybdis_cv_c_gcc_w_no_ctad_maybe_unsupported)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-disabled-macro-expansion], charybdis_cv_c_gcc_w_no_disabled_macro_expansion)
|
|
|
|
|
|
|
|
dnl Ignored for now
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-padded], charybdis_cv_c_gcc_w_no_padded)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-sign-conversion], charybdis_cv_c_gcc_w_no_sign_conversion)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-unused-exception-parameter], charybdis_cv_c_gcc_w_no_unused_exception_parameter)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-extra-semi], charybdis_cv_c_gcc_w_no_extra_semi)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-extra-semi-stmt], charybdis_cv_c_gcc_w_no_extra_semi_stmt)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-weak-vtables], charybdis_cv_c_gcc_w_no_weak_vtables)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-global-constructors], charybdis_cv_c_gcc_w_no_global_constructors)
|
|
|
|
|
|
|
|
dnl Ignored with issue low priority
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-old-style-cast], charybdis_cv_c_gcc_w_no_old_style_cast)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-float-conversion], charybdis_cv_c_gcc_w_no_implicit_int_conversion)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-implicit-int-conversion], charybdis_cv_c_gcc_w_no_implicit_int_conversion)
|
|
|
|
|
|
|
|
dnl Ignored with issue high priority
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-reserved-identifier], charybdis_cv_c_gcc_w_no_reserved_identifier)
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-reserved-macro-identifier], charybdis_cv_c_gcc_w_no_reserved_macro_identifier)
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF_NOT([UNTUNED],
|
|
|
|
[
|
|
|
|
dnl When tuning for a specific target ignore the ABI compat warnings
|
|
|
|
RB_MAYBE_CXXFLAG([-Wno-psabi], charybdis_cv_c_gcc_w_psabi)
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Truncate warning flags if disabled
|
|
|
|
AC_MSG_CHECKING(whether to disable warnings)
|
|
|
|
AC_ARG_ENABLE(warnings,
|
|
|
|
RB_HELP_STRING([--disable-warnings], [Disable all sorts of warnings like a rockstar]),
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
CWARNS=""
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
2020-02-04 06:42:10 +01:00
|
|
|
dnl assume the warning flags
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CPPFLAGS], ["$CWARNS"])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-02-04 06:42:10 +01:00
|
|
|
dnl mirror the base CFLAGS and CXXFLAGS up to this point
|
|
|
|
CFLAGS="$CXXFLAGS"
|
|
|
|
|
2022-06-14 03:27:38 +02:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2021-11-11 04:52:13 +01:00
|
|
|
dnl
|
2022-06-14 03:27:38 +02:00
|
|
|
dnl Linker flags
|
2021-11-11 04:52:13 +01:00
|
|
|
dnl
|
|
|
|
|
2022-06-14 03:27:38 +02:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
AM_CONDITIONAL([LLD], [test "" != ""])
|
|
|
|
dnl AM_CONDITIONAL([LLD], [test "$LDLLD" != ""])
|
|
|
|
AM_CONDITIONAL([GOLD], [test "$LDGOLD" != ""])
|
|
|
|
], [
|
|
|
|
AM_CONDITIONAL([LLD], [test "" != ""])
|
|
|
|
AM_CONDITIONAL([GOLD], [test "$LDGOLD" != ""])
|
|
|
|
])
|
2021-11-11 04:52:13 +01:00
|
|
|
|
2022-06-14 03:27:38 +02:00
|
|
|
AM_COND_IF_NAND([LLD], [GOLD],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Sorry, ld.gold required at this time.])
|
|
|
|
])
|
2021-11-11 04:52:13 +01:00
|
|
|
|
2022-06-14 03:27:38 +02:00
|
|
|
AM_COND_IF([LLD],
|
|
|
|
[
|
|
|
|
AC_SUBST(LD, "$LDLLD")
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([LLD],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-fuse-ld=lld"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wc,-fuse-ld=lld"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([GOLD],
|
2021-11-11 04:52:13 +01:00
|
|
|
[
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,-fuse-ld=gold"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--gdb-index"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-fuse-ld=gold"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wc,-fuse-ld=gold"])
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--warn-common"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--warn-execstack"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--detect-odr-violations"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--rosegment"])
|
|
|
|
dnl RB_VAR_PREPEND([LDFLAGS], ["-Wl,--icf=all"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,-z,noexecstack"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,-z,combreloc"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,-z,text-unlikely-segment"])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Note compact mode options available in both GOLD and LLD
|
|
|
|
AM_COND_IF([COMPACT],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--strip-all"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,--gc-sections"])
|
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2022-06-14 03:27:38 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2017-10-05 01:37:07 +02:00
|
|
|
dnl Philology checks
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_ISC_POSIX
|
|
|
|
AC_C_CONST
|
|
|
|
AC_C_INLINE
|
|
|
|
if test "$ac_cv_header_machine_endian_h" = "no" ; then
|
|
|
|
AC_C_BIGENDIAN
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_TYPE_PID_T
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_TYPE_UID_T
|
|
|
|
AC_TYPE_OFF_T
|
2017-10-05 01:37:07 +02:00
|
|
|
AC_TYPE_SIZE_T
|
|
|
|
AC_TYPE_SSIZE_T
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_TYPE_INTPTR_T
|
|
|
|
AC_TYPE_UINTPTR_T
|
2017-10-05 01:37:07 +02:00
|
|
|
|
2020-09-13 05:56:29 +02:00
|
|
|
dnl C standard type sizes on this platform
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([char])
|
|
|
|
AC_CHECK_SIZEOF([short])
|
|
|
|
AC_CHECK_SIZEOF([int])
|
|
|
|
AC_CHECK_SIZEOF([float])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_SIZEOF([long])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([double])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_SIZEOF([long long])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([long double])
|
2020-09-13 05:56:29 +02:00
|
|
|
|
|
|
|
dnl Check for the C++11/C++20 unicode character types and sizes
|
|
|
|
AC_CHECK_TYPES([char8_t])
|
|
|
|
AC_CHECK_SIZEOF([char8_t])
|
|
|
|
AC_CHECK_TYPES([char16_t])
|
|
|
|
AC_CHECK_SIZEOF([char16_t])
|
|
|
|
AC_CHECK_TYPES([char32_t])
|
|
|
|
AC_CHECK_SIZEOF([char32_t])
|
|
|
|
|
|
|
|
dnl Probe the details of 128-bit arithmetic support on this platform.
|
|
|
|
dnl see: include/ircd/portable.h
|
|
|
|
AC_CHECK_TYPES([int128_t])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([int128_t])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_TYPES([uint128_t])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([uint128_t])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_TYPES([__int128])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([__int128])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_TYPES([__int128_t])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([__int128_t])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_TYPES([__uint128_t])
|
2020-07-11 04:25:39 +02:00
|
|
|
AC_CHECK_SIZEOF([__uint128_t])
|
2017-10-05 01:37:07 +02:00
|
|
|
|
2020-09-13 05:56:29 +02:00
|
|
|
dnl Gauge the support of experimental compact floating point formats
|
2021-02-26 23:10:13 +01:00
|
|
|
AC_CHECK_TYPES([_Float16])
|
|
|
|
AC_CHECK_SIZEOF([_Float16])
|
|
|
|
AC_CHECK_TYPES([__fp16])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_SIZEOF([__fp16])
|
2021-02-26 23:10:13 +01:00
|
|
|
AC_CHECK_TYPES([__bf16])
|
2020-09-13 05:56:29 +02:00
|
|
|
AC_CHECK_SIZEOF([__bf16])
|
|
|
|
|
2017-10-05 01:37:07 +02:00
|
|
|
dnl -fsigned-char ensures 'char' is signed on all platforms
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CFLAGS], ["-fsigned-char"])
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fsigned-char"])
|
2017-10-05 01:37:07 +02:00
|
|
|
|
2020-03-08 23:16:02 +01:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2017-10-05 01:37:07 +02:00
|
|
|
dnl
|
|
|
|
dnl Header files
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_DEFUN([RB_CHK_SYSHEADER],
|
2016-07-01 05:04:00 +02:00
|
|
|
[
|
2019-02-19 00:44:59 +01:00
|
|
|
if test -z "$rb_have_sysheader_$2"; then
|
|
|
|
AC_CHECK_HEADER([$1],
|
|
|
|
[
|
|
|
|
rb_have_sysheader_$2=1;
|
|
|
|
AC_DEFINE([HAVE_$2], [1], [ Indication $1 is available. ])
|
|
|
|
RB_DEFINE_UNQUOTED([INC_$2], [$1>], [ The computed-include location of $1. ])
|
|
|
|
], [
|
|
|
|
RB_DEFINE_UNQUOTED([INC_$2], [stddef.h>], [ The dead-header in place of $1. ])
|
|
|
|
])
|
|
|
|
fi
|
2016-07-01 05:04:00 +02:00
|
|
|
])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_HEADER_STDBOOL
|
|
|
|
dnl AC_HEADER_STDC
|
2016-07-13 07:17:21 +02:00
|
|
|
|
2018-01-10 09:46:13 +01:00
|
|
|
dnl libc
|
|
|
|
RB_CHK_SYSHEADER(assert.h, [ASSERT_H])
|
|
|
|
RB_CHK_SYSHEADER(stdarg.h, [STDARG_H])
|
|
|
|
|
|
|
|
dnl libc++
|
|
|
|
RB_CHK_SYSHEADER(cstddef, [CSTDDEF])
|
|
|
|
RB_CHK_SYSHEADER(cstdint, [CSTDINT])
|
2019-03-15 21:01:26 +01:00
|
|
|
RB_CHK_SYSHEADER(cstdlib, [CSTDLIB])
|
2020-06-26 19:33:01 +02:00
|
|
|
RB_CHK_SYSHEADER(cstdarg, [CSTDARG])
|
|
|
|
RB_CHK_SYSHEADER(cassert, [CASSERT])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(limits, [LIMITS])
|
|
|
|
RB_CHK_SYSHEADER(type_traits, [TYPE_TRAITS])
|
|
|
|
RB_CHK_SYSHEADER(typeindex, [TYPEINDEX])
|
|
|
|
RB_CHK_SYSHEADER(variant, [VARIANT])
|
|
|
|
RB_CHK_SYSHEADER(utility, [UTILITY])
|
2020-08-01 07:12:14 +02:00
|
|
|
RB_CHK_SYSHEADER(execution, [EXECUTION])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(functional, [FUNCTIONAL])
|
|
|
|
RB_CHK_SYSHEADER(algorithm, [ALGORITHM])
|
|
|
|
RB_CHK_SYSHEADER(numeric, [NUMERIC])
|
|
|
|
RB_CHK_SYSHEADER(cmath, [CMATH])
|
2022-03-04 21:48:42 +01:00
|
|
|
RB_CHK_SYSHEADER(cfloat, [CFLOAT])
|
2018-11-12 00:53:25 +01:00
|
|
|
RB_CHK_SYSHEADER(cfenv, [CFENV])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(memory, [MEMORY])
|
|
|
|
RB_CHK_SYSHEADER(exception, [EXCEPTION])
|
|
|
|
RB_CHK_SYSHEADER(cerrno, [CERRNO])
|
|
|
|
RB_CHK_SYSHEADER(system_error, [SYSTEM_ERROR])
|
|
|
|
RB_CHK_SYSHEADER(map, [MAP])
|
|
|
|
RB_CHK_SYSHEADER(set, [SET])
|
|
|
|
RB_CHK_SYSHEADER(list, [LIST])
|
|
|
|
RB_CHK_SYSHEADER(stack, [STACK])
|
|
|
|
RB_CHK_SYSHEADER(queue, [QUEUE])
|
|
|
|
RB_CHK_SYSHEADER(deque, [DEQUE])
|
|
|
|
RB_CHK_SYSHEADER(array, [ARRAY])
|
|
|
|
RB_CHK_SYSHEADER(vector, [VECTOR])
|
|
|
|
RB_CHK_SYSHEADER(forward_list, [FORWARD_LIST])
|
|
|
|
RB_CHK_SYSHEADER(unordered_map, [UNORDERED_MAP])
|
|
|
|
RB_CHK_SYSHEADER(string, [STRING])
|
|
|
|
RB_CHK_SYSHEADER(cstring, [CSTRING])
|
|
|
|
RB_CHK_SYSHEADER(locale, [LOCALE])
|
2020-06-26 02:19:01 +02:00
|
|
|
RB_CHK_SYSHEADER(cuchar, [CUCHAR])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(codecvt, [CODECVT])
|
|
|
|
RB_CHK_SYSHEADER(sstream, [SSTREAM])
|
|
|
|
RB_CHK_SYSHEADER(fstream, [FSTREAM])
|
|
|
|
RB_CHK_SYSHEADER(iostream, [IOSTREAM])
|
2018-07-01 23:10:07 +02:00
|
|
|
RB_CHK_SYSHEADER(iosfwd, [IOSFWD])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(iomanip, [IOMANIP])
|
|
|
|
RB_CHK_SYSHEADER(cstdio, [CSTDIO])
|
|
|
|
RB_CHK_SYSHEADER(chrono, [CHRONO])
|
|
|
|
RB_CHK_SYSHEADER(ctime, [CTIME])
|
|
|
|
RB_CHK_SYSHEADER(atomic, [ATOMIC])
|
|
|
|
RB_CHK_SYSHEADER(thread, [THREAD])
|
|
|
|
RB_CHK_SYSHEADER(mutex, [MUTEX])
|
|
|
|
RB_CHK_SYSHEADER(shared_mutex, [SHARED_MUTEX])
|
|
|
|
RB_CHK_SYSHEADER(condition_variable, [CONDITION_VARIABLE])
|
|
|
|
RB_CHK_SYSHEADER(random, [RANDOM])
|
|
|
|
RB_CHK_SYSHEADER(bitset, [BITSET])
|
|
|
|
RB_CHK_SYSHEADER(string_view, [STRING_VIEW])
|
|
|
|
RB_CHK_SYSHEADER(optional, [OPTIONAL])
|
2018-01-18 06:35:10 +01:00
|
|
|
RB_CHK_SYSHEADER(new, [NEW])
|
2018-02-18 06:29:02 +01:00
|
|
|
RB_CHK_SYSHEADER(regex, [REGEX])
|
2019-02-28 19:17:07 +01:00
|
|
|
RB_CHK_SYSHEADER(memory_resource, [MEMORY_RESOURCE])
|
2019-03-02 20:40:12 +01:00
|
|
|
RB_CHK_SYSHEADER(filesystem, [FILESYSTEM])
|
2019-03-23 02:50:57 +01:00
|
|
|
RB_CHK_SYSHEADER(cxxabi.h, [CXXABI_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
|
|
|
|
dnl unix platform
|
|
|
|
RB_CHK_SYSHEADER(unistd.h, [UNISTD_H])
|
2018-11-13 03:50:09 +01:00
|
|
|
RB_CHK_SYSHEADER(signal.h, [SIGNAL_H])
|
2019-03-25 20:55:13 +01:00
|
|
|
RB_CHK_SYSHEADER(ifaddrs.h, [IFADDRS_H])
|
2020-03-06 20:41:09 +01:00
|
|
|
RB_CHK_SYSHEADER(netdb.h, [NETDB_H])
|
2019-05-03 15:05:09 +02:00
|
|
|
RB_CHK_SYSHEADER(fcntl.h, [FCNTL_H])
|
2019-06-03 05:38:00 +02:00
|
|
|
RB_CHK_SYSHEADER(elf.h, [ELF_H])
|
2019-05-28 03:36:12 +02:00
|
|
|
RB_CHK_SYSHEADER(link.h, [LINK_H])
|
2019-05-28 23:53:55 +02:00
|
|
|
RB_CHK_SYSHEADER(dlfcn.h, [DLFCN_H])
|
2019-09-20 01:22:22 +02:00
|
|
|
RB_CHK_SYSHEADER(execinfo.h, [EXECINFO_H])
|
2019-03-25 20:55:13 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/types.h, [SYS_TYPES_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/time.h, [SYS_TIME_H])
|
2018-10-18 18:26:04 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/stat.h, [SYS_STAT_H])
|
2019-01-02 01:29:11 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/statfs.h, [SYS_STATFS_H])
|
2018-10-18 18:26:04 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/statvfs.h, [SYS_STATVFS_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/resource.h, [SYS_RESOURCE_H])
|
|
|
|
RB_CHK_SYSHEADER(sys/syscall.h, [SYS_SYSCALL_H])
|
2018-01-21 11:09:13 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/utsname.h, [SYS_UTSNAME_H])
|
2019-04-02 20:10:34 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/ioctl.h, [SYS_IOCTL_H])
|
2019-04-03 19:29:39 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/mman.h, [SYS_MMAN_H])
|
2022-06-14 22:40:37 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/event.h, [SYS_EVENT_H])
|
2019-06-02 07:22:44 +02:00
|
|
|
RB_CHK_SYSHEADER(gnu/libc-version.h, [GNU_LIBC_VERSION_H])
|
2020-03-09 02:16:57 +01:00
|
|
|
RB_CHK_SYSHEADER(gnu/lib-names.h, [GNU_LIB_NAMES_H])
|
2016-08-24 03:36:20 +02:00
|
|
|
|
2018-01-10 01:48:05 +01:00
|
|
|
dnl linux platform
|
2019-01-17 20:21:57 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/auxv.h, [SYS_AUXV_H])
|
2020-03-16 19:59:08 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/sysinfo.h, [SYS_SYSINFO_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/eventfd.h, [SYS_EVENTFD_H])
|
2019-01-06 02:54:03 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/inotify.h, [SYS_INOTIFY_H])
|
2019-02-16 02:25:19 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/sysmacros.h, [SYS_SYSMACROS_H])
|
2020-10-27 13:24:44 +01:00
|
|
|
RB_CHK_SYSHEADER(sys/prctl.h, [SYS_PRCTL_H])
|
2022-06-14 22:40:37 +02:00
|
|
|
RB_CHK_SYSHEADER(sys/epoll.h, [SYS_EPOLL_H])
|
|
|
|
RB_CHK_SYSHEADER(sys/timerfd.h, [SYS_TIMERFD_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(linux/aio_abi.h, [LINUX_AIO_ABI_H])
|
2019-01-02 01:29:11 +01:00
|
|
|
RB_CHK_SYSHEADER(linux/magic.h, [LINUX_MAGIC_H])
|
2019-04-01 01:07:48 +02:00
|
|
|
RB_CHK_SYSHEADER(linux/perf_event.h, [LINUX_PERF_EVENT_H])
|
|
|
|
RB_CHK_SYSHEADER(linux/hw_breakpoint.h, [LINUX_HW_BREAKPOINT_H])
|
2019-08-10 15:41:20 +02:00
|
|
|
RB_CHK_SYSHEADER(linux/io_uring.h, [LINUX_IO_URING_H])
|
2019-08-22 17:53:26 +02:00
|
|
|
RB_CHK_SYSHEADER(linux/icmp.h, [LINUX_ICMP_H])
|
2021-10-06 22:07:21 +02:00
|
|
|
RB_CHK_SYSHEADER(linux/input-event-codes.h, [LINUX_INPUT_EVENT_CODES_H])
|
2018-01-10 09:46:13 +01:00
|
|
|
|
|
|
|
dnl windows platform
|
|
|
|
RB_CHK_SYSHEADER(windows.h, [WINDOWS_H])
|
|
|
|
RB_CHK_SYSHEADER(winsock2.h, [WINSOCK2_H])
|
|
|
|
RB_CHK_SYSHEADER(ws2tcpip.h, [WS2TCPIP_H])
|
|
|
|
RB_CHK_SYSHEADER(iphlpapi.h, [IPHLPAPI_H])
|
2018-01-10 01:48:05 +01:00
|
|
|
|
2018-02-05 19:47:46 +01:00
|
|
|
dnl x86 platform
|
|
|
|
RB_CHK_SYSHEADER(x86intrin.h, [X86INTRIN_H])
|
2019-04-01 01:06:17 +02:00
|
|
|
RB_CHK_SYSHEADER(cpuid.h, [CPUID_H])
|
2018-02-05 19:47:46 +01:00
|
|
|
|
2020-10-29 09:19:51 +01:00
|
|
|
dnl arm platform
|
|
|
|
RB_CHK_SYSHEADER(arm_acle.h, [ARM_ACLE_H])
|
|
|
|
RB_CHK_SYSHEADER(arm_cmse.h, [ARM_ACLE_H])
|
|
|
|
RB_CHK_SYSHEADER(arm_neon.h, [ARM_NEON_H])
|
|
|
|
RB_CHK_SYSHEADER(arm_sve.h, [ARM_SVE_H])
|
|
|
|
|
2019-04-17 09:35:04 +02:00
|
|
|
dnl instrumentation
|
|
|
|
RB_CHK_SYSHEADER(malloc.h, [MALLOC_H])
|
|
|
|
RB_CHK_SYSHEADER(valgrind/valgrind.h, [VALGRIND_VALGRIND_H])
|
|
|
|
RB_CHK_SYSHEADER(valgrind/memcheck.h, [VALGRIND_MEMCHECK_H])
|
2019-04-19 14:47:30 +02:00
|
|
|
RB_CHK_SYSHEADER(valgrind/callgrind.h, [VALGRIND_CALLGRIND_H])
|
2019-04-17 09:35:04 +02:00
|
|
|
|
2017-12-28 21:41:13 +01:00
|
|
|
dnl experimental
|
2018-01-10 09:46:13 +01:00
|
|
|
RB_CHK_SYSHEADER(experimental/string_view, [EXPERIMENTAL_STRING_VIEW])
|
|
|
|
RB_CHK_SYSHEADER(experimental/optional, [EXPERIMENTAL_OPTIONAL])
|
2019-06-17 22:16:40 +02:00
|
|
|
RB_CHK_SYSHEADER(experimental/memory_resource, [EXPERIMENTAL_MEMORY_RESOURCE])
|
2016-07-01 05:04:00 +02:00
|
|
|
|
2020-03-08 23:16:02 +01:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
2017-10-05 01:37:07 +02:00
|
|
|
dnl Specific function checks
|
|
|
|
dnl
|
2016-07-01 05:04:00 +02:00
|
|
|
|
2019-09-20 01:22:22 +02:00
|
|
|
AC_CHECK_FUNCS([ \
|
|
|
|
backtrace \
|
2020-09-07 20:08:54 +02:00
|
|
|
fadvise \
|
|
|
|
madvise \
|
2021-03-17 21:09:40 +01:00
|
|
|
mlock \
|
2020-05-30 06:23:32 +02:00
|
|
|
mlock2 \
|
2021-03-17 21:09:40 +01:00
|
|
|
mmap \
|
2022-02-21 20:03:21 +01:00
|
|
|
mprotect \
|
2022-02-24 02:10:20 +01:00
|
|
|
mremap \
|
2022-01-26 20:11:25 +01:00
|
|
|
msync \
|
2019-09-20 01:22:22 +02:00
|
|
|
posix_fadvise \
|
2020-09-07 20:08:54 +02:00
|
|
|
posix_madvise \
|
2019-09-20 01:22:22 +02:00
|
|
|
preadv2 \
|
|
|
|
pwritev2 \
|
|
|
|
strlcat \
|
|
|
|
strlcpy \
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_SEARCH_LIBS(dlinfo, dl, AC_DEFINE(HAVE_DLINFO, 1, [Define if you have dlinfo]))
|
|
|
|
AC_SEARCH_LIBS(nanosleep, rt posix4, AC_DEFINE(HAVE_NANOSLEEP, 1, [Define if you have nanosleep]))
|
2016-02-06 23:25:58 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
2016-07-01 05:04:00 +02:00
|
|
|
dnl Networking Functions
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
2016-03-20 08:07:06 +01:00
|
|
|
|
2020-03-08 23:16:02 +01:00
|
|
|
dnl
|
|
|
|
dnl ip6
|
|
|
|
dnl
|
|
|
|
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(ipv6, RB_HELP_STRING([--disable-ipv6], [Disable IPv6 support]),
|
2016-11-29 16:23:38 +01:00
|
|
|
[
|
2021-01-16 02:15:49 +01:00
|
|
|
ipv6=$enableval
|
2016-11-29 16:23:38 +01:00
|
|
|
], [
|
2019-03-25 00:34:51 +01:00
|
|
|
ipv6="yes"
|
2016-07-01 05:04:00 +02:00
|
|
|
])
|
|
|
|
|
2019-03-25 00:34:51 +01:00
|
|
|
AM_CONDITIONAL([HAVE_IPV6], [[[[ "$ipv6" = "yes" ]]]])
|
2016-07-01 05:04:00 +02:00
|
|
|
|
2019-03-25 00:34:51 +01:00
|
|
|
AM_COND_IF(HAVE_IPV6,
|
|
|
|
[
|
2016-07-01 05:04:00 +02:00
|
|
|
AC_DEFINE([HAVE_IPV6], [1], [IPv6 is supported])
|
2019-03-25 00:34:51 +01:00
|
|
|
],[])
|
2016-07-01 05:04:00 +02:00
|
|
|
|
2020-03-08 23:16:02 +01:00
|
|
|
dnl
|
|
|
|
dnl netdb / libnss_db
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_CHECK_FUNCS([ \
|
|
|
|
endprotoent \
|
|
|
|
getprotobyname \
|
|
|
|
getprotobyname_r \
|
|
|
|
setprotoent \
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Even if getprotobyname(3) is found linux tries to open nss_db at runtime and
|
|
|
|
dnl that surprises our user with trouble. The check catches it here FWIW.
|
|
|
|
AM_COND_IF(LINUX,
|
|
|
|
[
|
|
|
|
AC_CHECK_LIB([nss_db], [_nss_db_getprotobyname_r],
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_LIBNSS_DB, 1, [Define if you have libnss_db])
|
|
|
|
], [
|
|
|
|
AC_MSG_WARN([Missing libnss_db.so for getprotobyname(3) impl. Try apt-get install libnss-db])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
|
|
|
dnl Miscellaneous operating system specific
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_COND_IF(MINGW,
|
|
|
|
[
|
2016-07-01 05:04:00 +02:00
|
|
|
AC_DEFINE(HAVE_WIN32, [1], [Define to 1 if you are on windows])
|
2020-07-30 15:23:31 +02:00
|
|
|
RB_VAR_PREPEND([LIBS], ["-lws2_32 -liphlpapi"])
|
|
|
|
], [
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
RB_VAR_PREPEND([LIBS], ["-latomic"])
|
|
|
|
RB_VAR_PREPEND([LIBS], ["-lpthread"])
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-pthread"])
|
|
|
|
])
|
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
AM_COND_IF(INTERIX,
|
|
|
|
[
|
|
|
|
CPPDEFINE([_ALL_SOURCE])
|
|
|
|
CPPDEFINE([_XOPEN_SOURCE], [500])
|
|
|
|
CPPDEFINE([_POSIX_PTHREAD_SEMANTICS])
|
|
|
|
CPPDEFINE([_XPG4_2])
|
|
|
|
],[])
|
|
|
|
|
2018-01-11 06:30:31 +01:00
|
|
|
dnl
|
|
|
|
dnl Linux AIO support
|
|
|
|
dnl
|
|
|
|
|
2018-01-10 01:48:05 +01:00
|
|
|
AM_COND_IF(LINUX,
|
|
|
|
[
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(aio, RB_HELP_STRING([--disable-aio], [Disable kernel AIO support]),
|
2018-01-10 01:48:05 +01:00
|
|
|
[
|
2018-01-11 06:30:31 +01:00
|
|
|
aio=$enableval
|
2018-08-12 20:56:53 +02:00
|
|
|
], [
|
2018-01-11 06:30:31 +01:00
|
|
|
aio=yes
|
|
|
|
])
|
|
|
|
], [])
|
|
|
|
|
|
|
|
if test "$aio" = "yes"; then
|
|
|
|
IRCD_DEFINE(USE_AIO, [1], [Linux AIO is supported and will be used])
|
|
|
|
fi
|
2018-01-10 01:48:05 +01:00
|
|
|
|
2018-02-06 07:42:40 +01:00
|
|
|
AM_CONDITIONAL([AIO], [[[[ $aio = yes ]]]])
|
|
|
|
|
2019-08-11 07:06:08 +02:00
|
|
|
dnl
|
|
|
|
dnl Linux io_uring support
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_COND_IF(LINUX,
|
|
|
|
[
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_ENABLE(io_uring, RB_HELP_STRING([--disable-io_uring], [Disable kernel io_uring support]),
|
2019-08-11 07:06:08 +02:00
|
|
|
[
|
|
|
|
io_uring=$enableval
|
|
|
|
], [
|
|
|
|
io_uring="$ac_cv_header_linux_io_uring_h"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([IOU], [[[[ $io_uring = yes ]]]])
|
|
|
|
|
|
|
|
AM_COND_IF([IOU],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_IOU, [1], [Linux io_uring is supported and may be used])
|
|
|
|
])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Installation Layout
|
|
|
|
dnl
|
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
AC_PREFIX_DEFAULT([/usr])
|
|
|
|
AC_PREFIX_PROGRAM([/usr])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
PKG_PROG_PKG_CONFIG
|
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
AC_SUBST_DIR([prefix])
|
2016-07-20 20:55:46 +02:00
|
|
|
if test "$prefix" = "NONE"; then
|
2018-08-12 20:56:53 +02:00
|
|
|
prefix="$ac_default_prefix"
|
2016-07-20 20:55:46 +02:00
|
|
|
else
|
|
|
|
dnl Don't get bitten by Cygwin's stupidity if the user specified
|
|
|
|
dnl a custom prefix with a trailing slash
|
|
|
|
prefix=`echo $prefix | sed 's/\/$//'`
|
|
|
|
fi
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
RB_DEFINE_UNQUOTED(PREFIX, ["$prefix"], [Prefix of IRCd install])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl
|
2018-08-12 20:56:53 +02:00
|
|
|
dnl bindir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
AC_SUBST_DIR([bindir])
|
2018-09-14 08:05:55 +02:00
|
|
|
RB_DEFINE_UNQUOTED([BIN_DIR], ["$bindir"], [Directory where binary executables are to be found.])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
dnl
|
|
|
|
dnl Check for --with-confdir [deprecated, use --sysconfdir instead]
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST_DIR([sysconfdir])
|
|
|
|
RB_DEFINE_UNQUOTED([CONF_DIR], ["$sysconfdir"], [Prefix where config files are installed.])
|
|
|
|
|
2019-07-13 01:28:09 +02:00
|
|
|
dnl
|
|
|
|
dnl includedir
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST_DIR([includedir])
|
|
|
|
RB_DEFINE_UNQUOTED([INCLUDE_DIR], ["$includedir"], [Prefix where headers are installed.])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
2018-08-12 20:56:53 +02:00
|
|
|
dnl libdir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
AC_SUBST_DIR([libdir])
|
2018-09-14 08:05:55 +02:00
|
|
|
RB_DEFINE_UNQUOTED([LIB_DIR], ["$libdir"], [Prefix where libs are installed.])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl
|
2020-04-19 06:00:07 +02:00
|
|
|
dnl Check for --with-moduledir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
AC_SUBST_DIR([moduledir])
|
|
|
|
AC_MSG_CHECKING([whether to modify moduledir])
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_WITH(moduledir, RB_HELP_STRING([--with-moduledir=DIR], [Directory to install modules]),
|
2020-04-19 06:00:07 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
moduledir=`echo $withval | sed 's/\/$//'`
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
moduledir="${libdir}/modules/${PACKAGE_TARNAME}"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([MODULE_DIR], ["$moduledir"], [Prefix where modules are installed.])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl
|
2020-04-19 06:00:07 +02:00
|
|
|
dnl datarootdir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
AC_SUBST_DIR([datarootdir])
|
|
|
|
RB_DEFINE_UNQUOTED([DATAROOT_DIR], ["$datarootdir"], [Directory where read-only assets go.])
|
2018-09-14 05:59:52 +02:00
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl datadir
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST_DIR([datadir])
|
2020-04-19 06:00:07 +02:00
|
|
|
|
|
|
|
if test "x$datarootdir" = "x$datadir"; then
|
|
|
|
datadir="$datarootdir/${PACKAGE_TARNAME}"
|
|
|
|
fi
|
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([DATA_DIR], ["$datadir"], [Directory where read-only assets go.])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Check for --with-webappdir
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to modify webappdir])
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_WITH(webappdir, RB_HELP_STRING([--with-webappdir=DIR], [Directory to install served assets]),
|
2020-04-19 06:00:07 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
webappdir=`echo $withval | sed 's/\/$//'`
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
webappdir="${datadir}/webapp"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([WEBAPP_DIR], ["$webappdir"], [Prefix where website assets are served from.])
|
|
|
|
AC_SUBST_DIR([webappdir])
|
|
|
|
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl localstatedir
|
|
|
|
dnl
|
|
|
|
|
|
|
|
dnl Avoid name collisions.
|
|
|
|
AC_SUBST_DIR([localstatedir])
|
|
|
|
RB_DEFINE_UNQUOTED([LOCALSTATE_DIR], ["$localstatedir"], [Prefix where db and logs go.])
|
2018-09-14 05:59:52 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
2018-08-12 20:56:53 +02:00
|
|
|
dnl Check for --with-dbdir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
AC_MSG_CHECKING([whether to modify database directory])
|
2020-05-09 00:14:44 +02:00
|
|
|
AC_ARG_WITH(dbdir, RB_HELP_STRING([--with-dbdir=DIR], [Directory where databases are located]),
|
2018-08-12 20:56:53 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
dbdir=`echo $withval | sed 's/\/$//'`
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
dbdir="${localstatedir}/db/${PACKAGE_TARNAME}"
|
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
RB_DEFINE_UNQUOTED([DB_DIR], ["$dbdir"], [Directory where databases are located])
|
|
|
|
AC_SUBST_DIR([dbdir])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl
|
2018-08-12 20:56:53 +02:00
|
|
|
dnl Check for --with-logdir
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
AC_MSG_CHECKING([whether to modify logdir])
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_WITH(logdir, RB_HELP_STRING([--with-logdir=DIR], [Directory where to write logfiles]),
|
2018-08-12 20:56:53 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
logdir=`echo $withval | sed 's/\/$//'`
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
logdir="${localstatedir}/log/${PACKAGE_TARNAME}"
|
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2018-08-12 20:56:53 +02:00
|
|
|
RB_DEFINE_UNQUOTED([LOG_DIR], ["$logdir"], [Prefix where to write logfiles.])
|
|
|
|
AC_SUBST_DIR([logdir])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl
|
2020-04-19 06:00:07 +02:00
|
|
|
dnl runstatedir
|
2018-09-14 05:59:52 +02:00
|
|
|
dnl
|
|
|
|
|
2020-04-19 06:00:07 +02:00
|
|
|
AC_SUBST_DIR([runstatedir])
|
|
|
|
runstatedir="$runstatedir/${PACKAGE_TARNAME}"
|
|
|
|
RB_DEFINE_UNQUOTED([RUN_DIR], ["$runstatedir"], [Prefix where runtime ephemeral files go.])
|
2018-09-14 05:59:52 +02:00
|
|
|
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Third party
|
|
|
|
dnl
|
|
|
|
|
2020-06-19 09:05:23 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl unicode / icu
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(ICU_CPPFLAGS, [])
|
|
|
|
AC_SUBST(ICU_LDFLAGS, [])
|
|
|
|
AC_SUBST(ICU_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(icu-includes,
|
|
|
|
RB_HELP_STRING([--with-icu-includes=[[[DIR]]]], [Path to unicode include directory]),
|
|
|
|
[
|
|
|
|
ICU_CPPFLAGS+="-isystem $withval"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(icu-libs,
|
|
|
|
RB_HELP_STRING([--with-icu-libs=[[[DIR]]]], [Path to unicode libraries directory]),
|
|
|
|
[
|
|
|
|
ICU_LDFLAGS+=" -L$withval"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/utypes.h, [UNICODE_UTYPES_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/ustring.h, [UNICODE_USTRING_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/utext.h, [UNICODE_UTEXT_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/unistr.h, [UNICODE_UNISTR_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/chariter.h, [UNICODE_CHARITER_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/stringpiece.h, [UNICODE_STRINGPIECE_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/utf.h, [UNICODE_UTF_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uchar.h, [UNICODE_UCHAR_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uscript.h, [UNICODE_USCRIPT_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uset.h, [UNICODE_USET_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uniset.h, [UNICODE_UNISET_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uloc.h, [UNICODE_ULOC_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/locid.h, [UNICODE_LOCID_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/usearch.h, [UNICODE_USEARCH_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/stsearch.h, [UNICODE_STSEARCH_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/ubrk.h, [UNICODE_UBRK_H])
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/brkiter.h, [UNICODE_BRKITER_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/uidna.h, [UNICODE_UIDNA_H] )
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/idna.h, [UNICODE_IDNA_H])
|
|
|
|
|
|
|
|
dnl RB_CHK_SYSHEADER(unicode/utmscale.h, [UNICODE_UTMSCALE_H])
|
|
|
|
|
2020-09-24 02:10:03 +02:00
|
|
|
have_icu="no"
|
2020-06-19 09:05:23 +02:00
|
|
|
PKG_CHECK_MODULES(icuuc, [icuuc],
|
|
|
|
[
|
2020-09-24 02:10:03 +02:00
|
|
|
have_icu="yes"
|
2020-06-19 09:05:23 +02:00
|
|
|
have_icuuc="yes"
|
2020-06-19 10:04:30 +02:00
|
|
|
ICU_LIBS+=" -licuuc"
|
2020-06-19 09:05:23 +02:00
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([icuuc], [_init],
|
|
|
|
[
|
2020-09-24 02:10:03 +02:00
|
|
|
have_icu="yes"
|
2020-06-19 09:05:23 +02:00
|
|
|
have_icuuc="yes"
|
2020-06-19 10:04:30 +02:00
|
|
|
ICU_LIBS+=" -licuuc"
|
2020-06-19 09:05:23 +02:00
|
|
|
], [
|
|
|
|
have_icuuc="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ICUUC], [test "x$have_icuuc" = "xyes" ])
|
2020-09-24 02:10:03 +02:00
|
|
|
AM_CONDITIONAL([ICU], [test "x$have_icu" = "xyes" ])
|
2020-06-19 09:05:23 +02:00
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-15 04:58:56 +02:00
|
|
|
dnl
|
|
|
|
dnl libsodium (NaCl) crypto support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_SUBST(SODIUM_CPPFLAGS, [])
|
|
|
|
AC_SUBST(SODIUM_LDFLAGS, [])
|
|
|
|
AC_SUBST(SODIUM_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(sodium-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-sodium-includes=[[[DIR]]]], [Path to sodium include directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
2019-06-14 01:26:53 +02:00
|
|
|
SODIUM_CPPFLAGS+=" -I$withval"
|
2019-02-19 22:01:45 +01:00
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(sodium-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-sodium-libs=[[[DIR]]]], [Path to sodium library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
2019-06-14 01:26:53 +02:00
|
|
|
SODIUM_LDFLAGS+=" -L$withval"
|
2019-02-19 22:01:45 +01:00
|
|
|
], [])
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2020-05-10 02:06:38 +02:00
|
|
|
PKG_CHECK_MODULES(sodium, libsodium,
|
2018-06-15 04:58:56 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
have_sodium="yes"
|
|
|
|
], [
|
2019-06-07 00:02:09 +02:00
|
|
|
dnl NOTE that PKG_CHECK_MODULES is preferred, but on some systems it gives
|
|
|
|
dnl a false negative and we end up here with an AC_CHECK_LIB fallback.
|
2019-06-06 13:41:53 +02:00
|
|
|
AC_CHECK_LIB([sodium], sodium_init,
|
|
|
|
[
|
|
|
|
have_sodium="yes"
|
|
|
|
], [
|
|
|
|
have_sodium="no"
|
|
|
|
])
|
2018-06-15 04:58:56 +02:00
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AM_CONDITIONAL([SODIUM], [test "x$have_sodium" = "xyes"])
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2019-06-13 21:51:49 +02:00
|
|
|
AM_COND_IF([SODIUM],
|
|
|
|
[
|
2020-05-10 02:06:38 +02:00
|
|
|
RB_CHK_SYSHEADER(sodium.h, [SODIUM_H])
|
2019-06-13 21:51:49 +02:00
|
|
|
AC_DEFINE([HAVE_SODIUM], [1], [Have libsodium])
|
2020-05-10 02:06:38 +02:00
|
|
|
SODIUM_LIBS+=" -lsodium"
|
2019-06-13 21:51:49 +02:00
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([libsodium is required but not found. Try apt-get install libsodium-dev])
|
|
|
|
])
|
|
|
|
|
2018-09-03 12:02:35 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl OpenSSL support
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
2019-02-19 21:14:35 +01:00
|
|
|
AC_SUBST(SSL_CPPFLAGS, [])
|
|
|
|
AC_SUBST(SSL_LDFLAGS, [])
|
|
|
|
AC_SUBST(SSL_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(ssl,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-ssl=[[[DIR]]]], [Path to SSL source directory]),
|
2019-02-19 00:45:50 +01:00
|
|
|
[
|
2019-02-19 21:14:35 +01:00
|
|
|
SSL_CPPFLAGS="-I$withval/include"
|
|
|
|
SSL_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
2019-02-19 00:45:50 +01:00
|
|
|
|
2019-02-19 21:14:35 +01:00
|
|
|
AC_ARG_WITH(ssl-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-ssl-includes=[[[DIR]]]], [Path to SSL include directory]),
|
2019-02-19 21:14:35 +01:00
|
|
|
[
|
|
|
|
SSL_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(ssl-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-ssl-libs=[[[DIR]]]], [Path to SSL library directory]),
|
2019-02-19 21:14:35 +01:00
|
|
|
[
|
|
|
|
SSL_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(openssl/err.h, [OPENSSL_ERR_H])
|
2019-02-27 03:56:29 +01:00
|
|
|
RB_CHK_SYSHEADER(openssl/asn1.h, [OPENSSL_ASN1_H])
|
2019-02-19 21:14:35 +01:00
|
|
|
RB_CHK_SYSHEADER(openssl/sha.h, [OPENSSL_SHA_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/hmac.h, [OPENSSL_HMAC_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/ssl.h, [OPENSSL_SSL_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/ec.h, [OPENSSL_EC_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/rsa.h, [OPENSSL_RSA_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/x509.h, [OPENSSL_X509_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/evp.h, [OPENSSL_EVP_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/ripemd.h, [OPENSSL_RIPEMD_H])
|
|
|
|
RB_CHK_SYSHEADER(openssl/dh.h, [OPENSSL_DH_H])
|
2019-03-13 19:50:01 +01:00
|
|
|
RB_CHK_SYSHEADER(openssl/tls1.h, [OPENSSL_TLS1_H])
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(ssl, [ssl],
|
2018-09-03 12:02:35 +02:00
|
|
|
[
|
|
|
|
have_ssl="yes"
|
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(ssl, SSL_version,
|
|
|
|
[
|
|
|
|
have_ssl="yes"
|
|
|
|
], [
|
|
|
|
have_ssl="no"
|
|
|
|
AC_MSG_ERROR([libssl is required but not found. Try apt-get install libssl-dev])
|
|
|
|
])
|
2018-09-03 12:02:35 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([SSL], [test "x$have_ssl" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([SSL],
|
|
|
|
[
|
|
|
|
SSL_LIBS="-lssl"
|
|
|
|
])
|
|
|
|
|
2019-02-19 21:14:35 +01:00
|
|
|
AC_SUBST(CRYPTO_CPPFLAGS, [])
|
|
|
|
AC_SUBST(CRYPTO_LDFLAGS, [])
|
|
|
|
AC_SUBST(CRYPTO_LIBS, [])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(crypto, [crypto],
|
2018-09-03 12:02:35 +02:00
|
|
|
[
|
|
|
|
have_crypto="yes"
|
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(crypto, OPENSSL_init,
|
|
|
|
[
|
|
|
|
have_crypto="yes"
|
|
|
|
CRYPTO_LIBS="-lcrypto"
|
|
|
|
], [
|
|
|
|
have_crypto="no"
|
|
|
|
AC_MSG_ERROR([libcrypto is required but not found.])
|
|
|
|
])
|
2018-09-03 12:02:35 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([CRYPTO], [test "x$have_crypto" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([CRYPTO],
|
|
|
|
[
|
|
|
|
AC_DEFINE(HAVE_CRYPTO, 1, [Define to 1 if libcrypto (-lcrypto) is available.])
|
|
|
|
CRYPTO_LIBS="-lcrypto"
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-15 04:58:56 +02:00
|
|
|
dnl
|
2019-02-19 22:01:45 +01:00
|
|
|
dnl libmagic support
|
2018-06-15 04:58:56 +02:00
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_SUBST(MAGIC_CPPFLAGS, [])
|
|
|
|
AC_SUBST(MAGIC_LDFLAGS, [])
|
|
|
|
AC_SUBST(MAGIC_LIBS, [])
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(magic-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-magic-includes=[[[DIR]]]], [Path to magic include directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
MAGIC_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(magic-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-magic-libs=[[[DIR]]]], [Path to magic library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
MAGIC_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
2018-06-15 04:58:56 +02:00
|
|
|
|
2020-04-20 06:02:06 +02:00
|
|
|
AC_ARG_WITH(magic-file,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-magic-file=[[[FILE]]]], [Path to magic database file]),
|
2020-04-20 06:02:06 +02:00
|
|
|
[
|
|
|
|
MAGIC_FILE="$withval"
|
|
|
|
RB_DEFINE_UNQUOTED([MAGIC_FILE], ["$MAGIC_FILE"], [Magic file path])
|
|
|
|
], [
|
|
|
|
RB_DEFINE_UNQUOTED([MAGIC_FILE], [""], [Magic file path])
|
|
|
|
])
|
|
|
|
|
2018-06-15 04:58:56 +02:00
|
|
|
RB_CHK_SYSHEADER(magic.h, [MAGIC_H])
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(magic, [magic],
|
2018-06-15 04:58:56 +02:00
|
|
|
[
|
|
|
|
have_magic="yes"
|
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(magic, magic_version,
|
|
|
|
[
|
|
|
|
have_magic="yes"
|
|
|
|
], [
|
|
|
|
have_magic="no"
|
|
|
|
AC_MSG_ERROR([libmagic is required but not found. Try apt-get install libmagic-dev])
|
|
|
|
])
|
2018-06-15 04:58:56 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([MAGIC], [test "x$have_magic" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([MAGIC],
|
|
|
|
[
|
|
|
|
MAGIC_LIBS="-lmagic"
|
|
|
|
])
|
|
|
|
|
2020-09-22 01:20:23 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl zstd
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(ZSTD_CPPFLAGS)
|
|
|
|
AC_SUBST(ZSTD_LDFLAGS)
|
|
|
|
AC_SUBST(ZSTD_LIBS)
|
|
|
|
|
|
|
|
AC_ARG_WITH(zstd-includes,
|
|
|
|
RB_HELP_STRING([--with-zstd-includes=[[[DIR]]]], [Path to zstd include directory]),
|
|
|
|
[
|
|
|
|
ZSTD_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(zstd-libs,
|
|
|
|
RB_HELP_STRING([--with-zstd-libs=[[[DIR]]]], [Path to zstd library directory]),
|
|
|
|
[
|
|
|
|
ZSTD_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(zstd.h, [ZSTD_H])
|
|
|
|
PKG_CHECK_MODULES(zstd, [zstd],
|
|
|
|
[
|
|
|
|
have_zstd="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(zstd, ZSTD_versionNumber,
|
|
|
|
[
|
|
|
|
have_zstd="yes"
|
|
|
|
], [
|
|
|
|
have_zstd="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ZSTD], [test "x$have_zstd" = "xyes"])
|
|
|
|
|
|
|
|
AM_COND_IF([ZSTD],
|
|
|
|
[
|
|
|
|
ZSTD_LIBS="-lzstd"
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-03 17:29:20 +02:00
|
|
|
dnl
|
|
|
|
dnl zlib support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-03 17:29:20 +02:00
|
|
|
|
|
|
|
AC_SUBST(Z_CPPFLAGS)
|
|
|
|
AC_SUBST(Z_LDFLAGS)
|
|
|
|
AC_SUBST(Z_LIBS)
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(z-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-z-includes=[[[DIR]]]], [Path to zlib include directory]),
|
2018-06-03 17:29:20 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
Z_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
2018-06-03 17:29:20 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(z-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-z-libs=[[[DIR]]]], [Path to zlib library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
Z_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
2018-06-03 17:29:20 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
RB_CHK_SYSHEADER(zlib.h, [ZLIB_H])
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(zlib, [zlib],
|
2018-06-03 17:29:20 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
have_zlib="yes"
|
2018-06-03 17:29:20 +02:00
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(z, zlibVersion,
|
|
|
|
[
|
|
|
|
have_zlib="yes"
|
|
|
|
], [
|
|
|
|
have_zlib="no"
|
|
|
|
])
|
2018-06-03 17:29:20 +02:00
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AM_CONDITIONAL([ZLIB], [test "x$have_zlib" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([ZLIB],
|
|
|
|
[
|
|
|
|
ZLIB_LIBS="-lz"
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-03 17:29:20 +02:00
|
|
|
dnl
|
|
|
|
dnl lz4 support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-03 17:29:20 +02:00
|
|
|
|
|
|
|
AC_SUBST(LZ4_CPPFLAGS)
|
|
|
|
AC_SUBST(LZ4_LDFLAGS)
|
|
|
|
AC_SUBST(LZ4_LIBS)
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(lz4-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-lz4-includes=[[[DIR]]]], [Path to LZ4 include directory]),
|
2018-06-03 17:29:20 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
LZ4_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
2018-06-03 17:29:20 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(lz4-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-lz4-libs=[[[DIR]]]], [Path to LZ4 library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
LZ4_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
2018-06-03 17:29:20 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
RB_CHK_SYSHEADER(lz4.h, [LZ4_H])
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(lz4, [lz4],
|
2018-06-03 17:29:20 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
have_lz4="yes"
|
2018-06-03 17:29:20 +02:00
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(lz4, LZ4_versionNumber,
|
|
|
|
[
|
|
|
|
have_lz4="yes"
|
|
|
|
], [
|
|
|
|
have_lz4="no"
|
|
|
|
])
|
2018-06-03 17:29:20 +02:00
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AM_CONDITIONAL([LZ4], [test "x$have_lz4" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([LZ4],
|
|
|
|
[
|
|
|
|
LZ4_LIBS="-llz4"
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-04 23:48:04 +02:00
|
|
|
dnl
|
|
|
|
dnl snappy support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2018-06-04 23:48:04 +02:00
|
|
|
|
|
|
|
AC_SUBST(SNAPPY_CPPFLAGS)
|
|
|
|
AC_SUBST(SNAPPY_LDFLAGS)
|
|
|
|
AC_SUBST(SNAPPY_LIBS)
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(snappy-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-snappy-includes=[[[DIR]]]], [Path to snappy include directory]),
|
2018-06-04 23:48:04 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
SNAPPY_CPPFLAGS="-I$withval"
|
|
|
|
], [])
|
2018-06-04 23:48:04 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_ARG_WITH(snappy-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-snappy-libs=[[[DIR]]]], [Path to snappy library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
SNAPPY_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
2018-06-04 23:48:04 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
RB_CHK_SYSHEADER(snappy.h, [SNAPPY_H])
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(snappy, [snappy],
|
2018-06-04 23:48:04 +02:00
|
|
|
[
|
2019-02-19 22:01:45 +01:00
|
|
|
have_snappy="yes"
|
2018-06-04 23:48:04 +02:00
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB(snappy, snappy_compress,
|
|
|
|
[
|
|
|
|
have_snappy="yes"
|
|
|
|
], [
|
|
|
|
have_snappy="no"
|
|
|
|
])
|
2018-06-04 23:48:04 +02:00
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AM_CONDITIONAL([SNAPPY], [test "x$have_snappy" = "xyes"])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([SNAPPY],
|
|
|
|
[
|
|
|
|
SNAPPY_LIBS="-lsnappy"
|
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl libgmp support
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(GMP_CPPFLAGS, [])
|
|
|
|
AC_SUBST(GMP_LDFLAGS, [])
|
2020-02-04 04:02:23 +01:00
|
|
|
AC_SUBST(GMP_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(gmp-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-gmp-includes=[[[DIR]]]], [Path to libgmp include directory]),
|
2020-02-04 04:02:23 +01:00
|
|
|
[
|
|
|
|
GMP_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(gmp-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-gmp-libs=[[[DIR]]]], [Path to libgmp library directory]),
|
2020-02-04 04:02:23 +01:00
|
|
|
[
|
|
|
|
GMP_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(gmp, [gmp],
|
2020-02-04 04:02:23 +01:00
|
|
|
[
|
|
|
|
have_gmp="yes"
|
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB([gmp], [__gmp_version],
|
|
|
|
[
|
|
|
|
have_gmp="yes"
|
|
|
|
], [
|
|
|
|
have_gmp="no"
|
|
|
|
])
|
2020-02-04 04:02:23 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([GMP], [test "x$have_gmp" = "xyes" ])
|
2019-02-19 22:01:45 +01:00
|
|
|
|
2020-05-10 12:35:51 +02:00
|
|
|
AM_COND_IF([GMP],
|
|
|
|
[
|
|
|
|
GMP_LIBS="-lgmp"
|
|
|
|
], [
|
|
|
|
AC_MSG_WARN([Unable to find GNU Multi-Precision library (libgmp) on this system.])
|
|
|
|
])
|
|
|
|
|
2020-02-04 04:28:45 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl libpbc support
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(PBC_CPPFLAGS, [])
|
|
|
|
AC_SUBST(PBC_LDFLAGS, [])
|
|
|
|
AC_SUBST(PBC_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(pbc-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-pbc-includes=[[[DIR]]]], [Path to libpbc include directory]),
|
2020-02-04 04:28:45 +01:00
|
|
|
[
|
|
|
|
PBC_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(pbc-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-pbc-libs=[[[DIR]]]], [Path to libpbc library directory]),
|
2020-02-04 04:28:45 +01:00
|
|
|
[
|
|
|
|
PBC_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether you asked to use the Pairing-Based Cryptography library included here])
|
|
|
|
AC_ARG_WITH(included-pbc,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-included-pbc], [Use the libpbc sources from included submodule]),
|
2020-02-04 04:28:45 +01:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
have_pbc="yes"
|
|
|
|
with_included_pbc="yes"
|
|
|
|
AC_DEFINE(HAVE_PBC, 1, [Define to 1 if libpbc is available.])
|
|
|
|
|
|
|
|
PBC_CPPFLAGS="-isystem $PWD/deps/pbc/include"
|
|
|
|
PBC_LDFLAGS="-L$PWD/deps/pbc/"
|
|
|
|
PBC_LIBS="$PWD/deps/pbc/libpbc.a"
|
|
|
|
|
|
|
|
bash tools/buildpbc.sh
|
|
|
|
AS_IF([ test $? != 0 ],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Failed to build Pairing-Based Cryptography library included submodule])
|
|
|
|
])
|
|
|
|
], [
|
2022-06-14 00:50:26 +02:00
|
|
|
AC_MSG_RESULT([no])
|
2020-02-04 04:28:45 +01:00
|
|
|
with_included_pbc="no"
|
2020-05-10 12:35:51 +02:00
|
|
|
PKG_CHECK_MODULES(pbc, [pbc],
|
2020-02-04 04:28:45 +01:00
|
|
|
[
|
|
|
|
have_pbc="yes"
|
|
|
|
AC_DEFINE(HAVE_PBC, 1, [Define to 1 if libpbc is available.])
|
|
|
|
PBC_LIBS="-lpbc"
|
|
|
|
], [
|
2020-05-10 12:35:51 +02:00
|
|
|
AC_CHECK_LIB([pbc], [pbc_set_memory_functions],
|
|
|
|
[
|
|
|
|
have_pbc="yes"
|
|
|
|
AC_DEFINE(HAVE_PBC, 1, [Define to 1 if libpbc is available.])
|
|
|
|
PBC_LIBS="-lpbc"
|
|
|
|
], [
|
|
|
|
have_pbc="no"
|
|
|
|
AC_MSG_WARN([Unable to find Pairing-Based Cryptography (libpbc) on this system.])
|
|
|
|
])
|
2020-02-04 04:28:45 +01:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([PBC], [test "x$have_pbc" = "xyes" ])
|
|
|
|
|
2021-01-16 01:13:56 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl Portable Network Graphics (PNG) support
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(PNG_CPPFLAGS, [])
|
|
|
|
AC_SUBST(PNG_LDFLAGS, [])
|
|
|
|
AC_SUBST(PNG_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(png-includes,
|
|
|
|
RB_HELP_STRING([--with-png-includes=[[[DIR]]]], [Path to PNG include directory]),
|
|
|
|
[
|
|
|
|
PNG_CPPFLAGS+="-I$withval"
|
|
|
|
], [
|
|
|
|
PNG_CPPFLAGS+="-isystem /usr/include/GraphicsMagick/"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(png-libs,
|
|
|
|
RB_HELP_STRING([--with-png-libs=[[[DIR]]]], [Path to PNG library directory]),
|
|
|
|
[
|
|
|
|
PNG_LDFLAGS+="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([png.h], [PNG_H])
|
|
|
|
PKG_CHECK_MODULES(PNG, [png],
|
|
|
|
[
|
|
|
|
dnl May not be DT_NEEDED in actual library since Magick loads it dynamically.
|
|
|
|
PNG_LIBS+="-lpng"
|
|
|
|
have_png="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([png], [png_access_version_number],
|
|
|
|
[
|
|
|
|
have_png="yes"
|
|
|
|
PNG_LIBS+="-lpng"
|
|
|
|
], [
|
|
|
|
have_png="no"
|
|
|
|
AC_MSG_WARN([Unable to find libpng for portable network graphics on this system.])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([PNG], [test "x$have_png" = "xyes"])
|
|
|
|
|
|
|
|
dnl IRCD_ENABLE_MAGICK is always defined for use in a constexpr if
|
|
|
|
AM_COND_IF([PNG],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_PNG, [1], [Portable Network Graphics (PNG) support is available and enabled])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_PNG, [0], [Portable Network Graphics (PNG) support is unavailable or disabled])
|
|
|
|
])
|
|
|
|
|
2019-05-29 03:12:28 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl ImageMagick support
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(IMAGEMAGICK_CPPFLAGS, [])
|
|
|
|
AC_SUBST(IMAGEMAGICK_LDFLAGS, [])
|
|
|
|
AC_SUBST(IMAGEMAGICK_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(imagemagick-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-imagemagick-includes=[[[DIR]]]], [Path to imagemagick include directory]),
|
2019-05-29 03:12:28 +02:00
|
|
|
[
|
|
|
|
IMAGEMAGICK_CPPFLAGS+="-I$withval"
|
|
|
|
], [
|
|
|
|
IMAGEMAGICK_CPPFLAGS+="-isystem /usr/include/GraphicsMagick/"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(imagemagick-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-imagemagick-libs=[[[DIR]]]], [Path to imagemagick library directory]),
|
2019-05-29 03:12:28 +02:00
|
|
|
[
|
|
|
|
IMAGEMAGICK_LDFLAGS+="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
dnl push
|
|
|
|
restore_cppflags=$CPPFLAGS
|
|
|
|
restore_ldflags=$LDFLAGS
|
2020-07-09 00:31:57 +02:00
|
|
|
RB_VAR_PREPEND([CPPFLAGS], ["${IMAGEMAGICK_CPPFLAGS}"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["${IMAGEMAGICK_LDFLAGS}"])
|
2019-05-29 03:12:28 +02:00
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([Magick++.h], [MAGICKPP_H])
|
|
|
|
PKG_CHECK_MODULES(GraphicsMagickPP, [GraphicsMagick++],
|
|
|
|
[
|
|
|
|
IMAGEMAGICK_LIBS+=" -lGraphicsMagick++"
|
|
|
|
have_imagemagickpp="yes"
|
|
|
|
], [
|
|
|
|
have_imagemagickpp="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([wand/wand_api.h], [MAGICK_WAND_API_H])
|
|
|
|
PKG_CHECK_MODULES(GraphicsMagickWand, [GraphicsMagickWand],
|
|
|
|
[
|
|
|
|
IMAGEMAGICK_LIBS+=" -lGraphicsMagickWand"
|
|
|
|
have_imagemagickwand="yes"
|
|
|
|
], [
|
|
|
|
have_imagemagickwand="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([magick/api.h], [MAGICK_API_H])
|
|
|
|
PKG_CHECK_MODULES(GraphicsMagick, [GraphicsMagick],
|
|
|
|
[
|
|
|
|
IMAGEMAGICK_LIBS+=" -lGraphicsMagick"
|
|
|
|
have_imagemagick="yes"
|
|
|
|
], [
|
|
|
|
have_imagemagick="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl pop
|
|
|
|
CPPFLAGS=$restore_cppflags
|
|
|
|
LDFLAGS=$restore_ldflags
|
|
|
|
|
|
|
|
AM_CONDITIONAL([IMAGEMAGICK], [test "x$have_imagemagick" = "xyes"])
|
|
|
|
|
2020-09-06 00:36:55 +02:00
|
|
|
dnl IRCD_ENABLE_MAGICK is always defined for use in a constexpr if
|
|
|
|
AM_COND_IF([IMAGEMAGICK],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_MAGICK, [1], [Magick support is available and enabled])
|
|
|
|
])
|
|
|
|
|
2020-10-08 00:19:57 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl jemalloc
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(jemalloc/jemalloc.h, [JEMALLOC_H])
|
|
|
|
PKG_CHECK_MODULES(jemalloc, [jemalloc],
|
|
|
|
[
|
|
|
|
have_jemalloc="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(jemalloc, malloc,
|
|
|
|
[
|
|
|
|
have_jemalloc="yes"
|
|
|
|
], [
|
|
|
|
have_jemalloc="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2022-03-04 21:46:41 +01:00
|
|
|
AC_MSG_CHECKING(whether to disable use of any found jemalloc)
|
2020-10-08 00:19:57 +02:00
|
|
|
AC_ARG_ENABLE(jemalloc, RB_HELP_STRING([--disable-jemalloc], [Disable jemalloc as third-party dynamic memory manager]),
|
|
|
|
[
|
2022-06-20 05:51:42 +02:00
|
|
|
enable_jemalloc=$enableval
|
|
|
|
if test "$enable_jemalloc" = "no"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
fi
|
2020-10-08 00:19:57 +02:00
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
enable_jemalloc="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([JEMALLOC], [test "x$have_jemalloc" = "xyes" && test "x$enable_jemalloc" = "xyes" ])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl Select a third-party allocator
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(MALLOC_CPPFLAGS)
|
|
|
|
AC_SUBST(MALLOC_CXXFLAGS)
|
|
|
|
AC_SUBST(MALLOC_LDFLAGS)
|
|
|
|
alloc_lib="standard"
|
|
|
|
|
|
|
|
dnl ALLOC_LIBS true unless --disable-alloc-libs configured
|
|
|
|
AM_COND_IF([MALLOC_LIBS],
|
|
|
|
[
|
|
|
|
AM_COND_IF([JEMALLOC],
|
|
|
|
[
|
|
|
|
alloc_lib="jemalloc"
|
2022-03-26 06:54:21 +01:00
|
|
|
RB_VAR_PREPEND([LIBS], ["-ljemalloc"])
|
2020-10-08 00:19:57 +02:00
|
|
|
AC_DEFINE(IRCD_ALLOCATOR_USE_JEMALLOC, 1, [Use jemalloc as the allocator])
|
|
|
|
], [
|
|
|
|
AC_DEFINE(IRCD_ALLOCATOR_USE_DEFAULT, 1, [Use the default allocator])
|
|
|
|
])
|
|
|
|
], [
|
|
|
|
AC_DEFINE(IRCD_ALLOCATOR_USE_DEFAULT, 1, [Use the default allocator])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl libLLVM
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(LLVM_CPPFLAGS, [])
|
|
|
|
AC_SUBST(LLVM_LDFLAGS, [])
|
|
|
|
AC_SUBST(LLVM_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(llvm-includes,
|
|
|
|
RB_HELP_STRING([--with-llvm-includes=[[[DIR]]]], [Path to libllvm include directory]),
|
|
|
|
[
|
|
|
|
LLVM_CPPFLAGS="-isystem $withval"
|
|
|
|
], [
|
2021-12-20 22:17:43 +01:00
|
|
|
LLVM_CPPFLAGS="-isystem /usr/lib/llvm-${CXX_EPOCH}/include"
|
2020-10-08 00:19:57 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(llvm-libs,
|
|
|
|
RB_HELP_STRING([--with-llvm-libs=[[[DIR]]]], [Path to libllvm library directory]),
|
|
|
|
[
|
|
|
|
LLVM_LDFLAGS="-L$withval"
|
|
|
|
], [
|
2021-12-20 22:17:43 +01:00
|
|
|
LLVM_LDFLAGS="-L/usr/lib/llvm-${CXX_EPOCH}/lib"
|
2020-10-08 00:19:57 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(LLVM, [LLVM],
|
|
|
|
[
|
|
|
|
have_libllvm="yes"
|
|
|
|
LLVM_LIBS="-lLLVM"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([LLVM], [LLVMBuildAnd],
|
|
|
|
[
|
|
|
|
have_libllvm="yes"
|
|
|
|
LLVM_LIBS="-lLLVM"
|
|
|
|
], [
|
|
|
|
have_libllvm="no"
|
|
|
|
AC_MSG_WARN([Unable to find LLVM compiler infrastructure library on this system.])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([LLVM], [test "x$have_libllvm" = "xyes" ])
|
|
|
|
|
2022-04-10 20:16:47 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl LibDRM
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(DRM_CPPFLAGS, [])
|
|
|
|
AC_SUBST(DRM_LDFLAGS, [])
|
|
|
|
AC_SUBST(DRM_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(drm-includes,
|
|
|
|
RB_HELP_STRING([--with-drm-includes=[[[DIR]]]], [Path to DRM include directory]),
|
|
|
|
[
|
|
|
|
drm_incdir="$withval"
|
|
|
|
DRM_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(drm-libs,
|
|
|
|
RB_HELP_STRING([--with-drm-libs=[[[DIR]]]], [Path to DRM library directory]),
|
|
|
|
[
|
|
|
|
drm_libdir="$withval"
|
|
|
|
DRM_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([xf86drm.h], [XF86DRM_H])
|
|
|
|
RB_CHK_SYSHEADER([drm/drm.h], [DRM_DRM_H])
|
|
|
|
PKG_CHECK_MODULES(libdrm, [DRM],
|
|
|
|
[
|
|
|
|
have_drm="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(drm, drmOpen,
|
|
|
|
[
|
|
|
|
have_drm="yes"
|
|
|
|
], [
|
|
|
|
have_drm="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable use of any found DRM)
|
|
|
|
AM_CONDITIONAL([DRM], [test "x$have_drm" = "xyes"])
|
|
|
|
|
|
|
|
AM_COND_IF([DRM],
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
IRCD_DEFINE(USE_DRM, [1], [DRM support is available and enabled])
|
|
|
|
DRM_LIBS+="-ldrm"
|
|
|
|
])
|
|
|
|
|
2020-10-08 00:41:32 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl OpenCL
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(OPENCL_CPPFLAGS, [])
|
|
|
|
AC_SUBST(OPENCL_LDFLAGS, [])
|
|
|
|
AC_SUBST(OPENCL_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(opencl-includes,
|
|
|
|
RB_HELP_STRING([--with-opencl-includes=[[[DIR]]]], [Path to OpenCL include directory]),
|
|
|
|
[
|
|
|
|
opencl_incdir="$withval"
|
|
|
|
OPENCL_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(opencl-libs,
|
|
|
|
RB_HELP_STRING([--with-opencl-libs=[[[DIR]]]], [Path to OpenCL library directory]),
|
|
|
|
[
|
|
|
|
opencl_libdir="$withval"
|
|
|
|
OPENCL_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(CL/cl.h, [CL_CL_H])
|
|
|
|
RB_CHK_SYSHEADER(CL/opencl.h, [CL_OPENCL_H])
|
|
|
|
PKG_CHECK_MODULES(OpenCL, [OpenCL],
|
|
|
|
[
|
|
|
|
have_opencl="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(OpenCL, clGetPlatformInfo,
|
|
|
|
[
|
|
|
|
have_opencl="yes"
|
|
|
|
], [
|
|
|
|
have_opencl="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES(MesaOpenCL, [MesaOpenCL],
|
|
|
|
[
|
|
|
|
have_mesa_opencl="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(MesaOpenCL, clGetPlatformInfo,
|
|
|
|
[
|
|
|
|
have_mesa_opencl="yes"
|
|
|
|
], [
|
|
|
|
have_mesa_opencl="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_MSG_CHECKING(whether to disable use of any found OpenCL)
|
2021-01-16 01:40:42 +01:00
|
|
|
AC_ARG_ENABLE(opencl, RB_HELP_STRING([--disable-opencl], [Disable OpenCL support]),
|
2020-10-08 00:41:32 +02:00
|
|
|
[
|
2021-01-16 02:15:49 +01:00
|
|
|
AC_MSG_RESULT([$enableval])
|
|
|
|
enable_opencl=$enableval
|
2021-01-16 01:40:42 +01:00
|
|
|
], [
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_MSG_RESULT([no])
|
2021-01-16 01:40:42 +01:00
|
|
|
enable_opencl="yes"
|
2020-10-08 00:41:32 +02:00
|
|
|
])
|
|
|
|
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_MSG_CHECKING(whether to enable use of any found OpenCL)
|
2020-10-08 00:41:32 +02:00
|
|
|
AM_CONDITIONAL([OPENCL], [test "x$have_opencl" = "xyes" && test "x$enable_opencl" = "xyes" ])
|
|
|
|
AM_CONDITIONAL([MESA_OPENCL], [test "x$have_mesa_opencl" = "xyes"])
|
|
|
|
|
|
|
|
AM_COND_IF([OPENCL],
|
|
|
|
[
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_MSG_RESULT([yes])
|
2020-10-08 00:41:32 +02:00
|
|
|
IRCD_DEFINE(USE_OPENCL, [1], [OpenCL support is available and enabled])
|
|
|
|
OPENCL_LIBS+="-lOpenCL"
|
|
|
|
|
|
|
|
AM_COND_IF([MESA_OPENCL],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_MESA_OPENCL, [1], [MesaOpenCL support is available and enabled])
|
|
|
|
OPENCL_LIBS+=" -lMesaOpenCL"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2021-03-13 23:39:45 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl Arm NN
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(ARMNN_CPPFLAGS, [])
|
|
|
|
AC_SUBST(ARMNN_LDFLAGS, [])
|
|
|
|
AC_SUBST(ARMNN_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(armnn-includes,
|
|
|
|
RB_HELP_STRING([--with-armnn-includes=[[[DIR]]]], [Path to Arm NN include directory]),
|
|
|
|
[
|
|
|
|
armnn_incdir="$withval"
|
|
|
|
ARMNN_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(armnn-libs,
|
|
|
|
RB_HELP_STRING([--with-armnn-libs=[[[DIR]]]], [Path to Arm NN library directory]),
|
|
|
|
[
|
|
|
|
armnn_libdir="$withval"
|
|
|
|
ARMNN_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(armnn/ArmNN.hpp, [ARMNN_ARMNN_HPP])
|
|
|
|
PKG_CHECK_MODULES(armnn, [armnn],
|
|
|
|
[
|
|
|
|
have_armnn="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(armnn, _ZN5armnn7RuntimeD1Ev,
|
|
|
|
[
|
|
|
|
have_armnn="yes"
|
|
|
|
], [
|
|
|
|
have_armnn="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to enable use of any found ArmNN)
|
|
|
|
AC_ARG_ENABLE(armnn, RB_HELP_STRING([--disable-armnn], [Disable Arm NN support]),
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([$enableval])
|
|
|
|
enable_armnn=$enableval
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
enable_armnn="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ARMNN], [test "x$have_armnn" = "xyes" && test "x$enable_armnn" = "xyes" ])
|
|
|
|
|
|
|
|
AM_COND_IF([ARMNN],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_ARMNN, [1], [Arm NN support is available and enabled])
|
|
|
|
ARMNN_LIBS+="-larmnn"
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
dnl boost support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2017-12-29 23:53:39 +01:00
|
|
|
BOOST_VERSION_MIN="1.66"
|
2017-11-30 20:20:47 +01:00
|
|
|
BOOST_VERSION_MIN_PATCH="0"
|
2019-04-06 01:56:51 +02:00
|
|
|
BOOST_BUILT_LIBS="system,filesystem,context,coroutine,chrono"
|
2016-08-14 00:08:24 +02:00
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
AC_SUBST(BOOST_CPPFLAGS, [])
|
|
|
|
AC_SUBST(BOOST_LDFLAGS, [])
|
|
|
|
AC_SUBST(BOOST_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(boost-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-boost-includes=[[[DIR]]]], [Path to boost include directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
boost_incdir="$withval"
|
|
|
|
BOOST_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(boost-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-boost-libs=[[[DIR]]]], [Path to boost library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
boost_libdir="$withval"
|
|
|
|
BOOST_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
2016-08-14 00:08:24 +02:00
|
|
|
AC_MSG_CHECKING([whether you asked to use boost sources included here])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_ARG_WITH(included-boost,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-included-boost[[[=shared]]]], [Use the boost sources from included submodule]),
|
2016-07-20 20:55:46 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_MSG_NOTICE([Bootstrapping boost])
|
|
|
|
|
2018-01-27 18:33:55 +01:00
|
|
|
AM_COND_IF([DEBUG],
|
2016-07-20 20:55:46 +02:00
|
|
|
[
|
2018-12-29 00:47:49 +01:00
|
|
|
dnl boost_variant="debug"
|
|
|
|
boost_variant="release"
|
2016-07-20 20:55:46 +02:00
|
|
|
], [
|
2018-01-27 18:33:55 +01:00
|
|
|
boost_variant="release"
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
2017-08-23 23:29:34 +02:00
|
|
|
AM_COND_IF([MINGW],
|
|
|
|
[
|
2018-01-27 18:33:55 +01:00
|
|
|
BTOOLSET="mingw"
|
2018-01-28 05:46:41 +01:00
|
|
|
boost_libdir="$PWD/deps/boost/stage/lib"
|
2017-08-23 23:29:34 +02:00
|
|
|
], [
|
2018-01-27 18:33:55 +01:00
|
|
|
dnl the CXX may have a space and then arguments so we must chop them
|
|
|
|
BTOOLSET=`echo $CXX | cut -d' ' -f1`
|
2018-01-28 05:46:41 +01:00
|
|
|
boost_libdir="$PWD/deps/boost/lib"
|
2017-08-23 23:29:34 +02:00
|
|
|
])
|
|
|
|
|
2019-02-19 22:01:45 +01:00
|
|
|
BOOST_LDFLAGS="-L$boost_libdir"
|
|
|
|
BOOST_CPPFLAGS="-isystem $PWD/deps/boost/include"
|
2017-08-23 23:29:34 +02:00
|
|
|
|
2016-08-14 00:08:24 +02:00
|
|
|
AC_MSG_CHECKING([whether to use shared boost])
|
2018-08-25 23:30:55 +02:00
|
|
|
if [[ $withval = "static" ]]; then
|
2016-08-14 00:08:24 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
withval="static"
|
2018-08-25 23:30:55 +02:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
BOOST_LDFLAGS+=" -Wl,-rpath=$boost_libdir"
|
|
|
|
withval="shared"
|
2016-08-14 00:08:24 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
boost_linkage="$withval"
|
2017-11-30 20:20:47 +01:00
|
|
|
boost_version="boost-${BOOST_VERSION_MIN}.${BOOST_VERSION_MIN_PATCH}"
|
2022-06-18 04:27:28 +02:00
|
|
|
boost_cxxflags="-std=gnu++20"
|
2018-12-22 02:49:02 +01:00
|
|
|
bash tools/boostrap.sh $BTOOLSET $BOOST_BUILT_LIBS $boost_variant $withval multi $boost_version $boost_cxxflags
|
2018-01-28 05:46:41 +01:00
|
|
|
AS_IF([ test $? != 0 ],
|
|
|
|
[
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_ERROR([Failed to build included boost.])
|
2018-01-28 05:46:41 +01:00
|
|
|
])
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2019-05-14 23:46:47 +02:00
|
|
|
AC_DEFINE(RB_INCLUDED_BOOST, 1, [Defined if configured with included boost])
|
2016-07-25 05:31:08 +02:00
|
|
|
AC_MSG_NOTICE([Bootstrapping boost: done])
|
2016-07-20 20:55:46 +02:00
|
|
|
],[
|
2016-07-25 05:31:08 +02:00
|
|
|
AC_MSG_RESULT([no])
|
2016-08-14 00:08:24 +02:00
|
|
|
AX_BOOST_BASE([$BOOST_VERSION_MIN],
|
|
|
|
[
|
|
|
|
with_included_boost="no"
|
2016-07-20 20:55:46 +02:00
|
|
|
], [
|
2016-08-14 00:08:24 +02:00
|
|
|
with_included_boost="yes"
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_ERROR([Failed to find boost_system library. (try --with-included-boost)])
|
|
|
|
])
|
2016-08-14 00:08:24 +02:00
|
|
|
|
2016-07-31 02:56:01 +02:00
|
|
|
AX_BOOST_ASIO
|
|
|
|
AX_BOOST_SYSTEM
|
2016-08-26 02:08:05 +02:00
|
|
|
AX_BOOST_FILESYSTEM
|
2019-02-19 22:03:16 +01:00
|
|
|
AX_BOOST_COROUTINE
|
|
|
|
AX_BOOST_CONTEXT
|
2019-04-06 01:56:51 +02:00
|
|
|
AX_BOOST_CHRONO
|
2016-08-14 00:08:24 +02:00
|
|
|
boost_linkage="shared"
|
2016-07-20 20:55:46 +02:00
|
|
|
])
|
|
|
|
|
2016-07-25 05:31:08 +02:00
|
|
|
if [[ "$boost_linkage" = "shared" ]]; then
|
|
|
|
AM_COND_IF([MINGW],
|
|
|
|
[
|
2016-09-05 17:53:36 +02:00
|
|
|
AC_SUBST(BOOST_LIBS, ["-lboost_coroutine-mgw53-1_61.dll -lboost_context-mgw53-1_61.dll -lboost_thread-mgw53-1_61.dll -lboost_filesystem-mgw53-1_61.dll -lboost_system-mgw53-1_61.dll"])
|
2016-07-25 05:31:08 +02:00
|
|
|
], [
|
2019-04-06 01:56:51 +02:00
|
|
|
AC_SUBST(BOOST_LIBS, ["-lboost_coroutine -lboost_context -lboost_thread -lboost_filesystem -lboost_chrono -lboost_system"])
|
2016-07-25 05:31:08 +02:00
|
|
|
])
|
|
|
|
else
|
|
|
|
AM_COND_IF([MINGW],
|
|
|
|
[
|
2016-09-05 17:53:36 +02:00
|
|
|
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_coroutine-mgw53-1_61.dll.a $boost_libdir/libboost_context-mgw53-1_61.dll.a $boost_libdir/libboost_thread-mgw53-1_61.dll.a $boost_libdir/libboost_filesystem-mgw53-1_61.dll.a $boost_libdir/libboost_system-mgw53-1_61.dll.a"])
|
2016-07-25 05:31:08 +02:00
|
|
|
], [
|
2016-11-29 16:23:38 +01:00
|
|
|
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_coroutine.a $boost_libdir/libboost_context.a $boost_libdir/libboost_thread.a $boost_libdir/libboost_filesystem.a $boost_libdir/libboost_system.a"])
|
2016-07-25 05:31:08 +02:00
|
|
|
])
|
|
|
|
fi
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2020-10-11 20:44:34 +02:00
|
|
|
dnl Units which require boost::asio use these flags. This includes the
|
|
|
|
dnl ircd/asio.h PCH, which includes ircd.h upstream in the precompile.
|
|
|
|
AC_SUBST(ASIO_UNIT_CPPFLAGS)
|
|
|
|
ASIO_UNIT_CPPFLAGS+=" $BOOST_CPPFLAGS"
|
|
|
|
ASIO_UNIT_CPPFLAGS+=" $SSL_CPPFLAGS"
|
|
|
|
ASIO_UNIT_CPPFLAGS+=" $CRYPTO_CPPFLAGS"
|
|
|
|
ASIO_UNIT_CPPFLAGS+=" -include ircd/asio.h"
|
|
|
|
|
|
|
|
dnl Units defining spirit grammars may benefit from special compiler flags due
|
|
|
|
dnl to their various complexities. The ./configure may have generated flags
|
|
|
|
dnl in $GRAMMAR_UNIT_CXXFLAGS to improve compile time and reduce debug symbol.
|
|
|
|
AC_SUBST(SPIRIT_UNIT_CPPFLAGS)
|
|
|
|
SPIRIT_UNIT_CPPFLAGS+=" $ICU_CPPFLAGS"
|
|
|
|
SPIRIT_UNIT_CPPFLAGS+=" $BOOST_CPPFLAGS"
|
|
|
|
SPIRIT_UNIT_CPPFLAGS+=" -include ircd/spirit.h"
|
|
|
|
|
|
|
|
AC_SUBST(SPIRIT_UNIT_CXXFLAGS)
|
|
|
|
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
SPIRIT_UNIT_CXXFLAGS+=" -fno-var-tracking"
|
|
|
|
SPIRIT_UNIT_CXXFLAGS+=" -fno-var-tracking-assignments"
|
|
|
|
SPIRIT_UNIT_CXXFLAGS+=" -femit-struct-debug-baseonly"
|
|
|
|
|
|
|
|
AM_COND_IF([LOWMEM_COMPILE],
|
|
|
|
[
|
|
|
|
SPIRIT_UNIT_CXXFLAGS+=" --param ggc-min-expand=1"
|
|
|
|
SPIRIT_UNIT_CXXFLAGS+=" -fno-ipa-pta"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-09-24 06:01:57 +02:00
|
|
|
dnl
|
|
|
|
dnl RocksDB support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-09-24 06:01:57 +02:00
|
|
|
|
2020-05-07 05:26:13 +02:00
|
|
|
ROCKSDB_VERSION_DEFAULT="v6.6.4"
|
2019-02-19 22:01:45 +01:00
|
|
|
|
|
|
|
AC_SUBST(ROCKSDB_CPPFLAGS, [])
|
|
|
|
AC_SUBST(ROCKSDB_LDFLAGS, [])
|
|
|
|
AC_SUBST(ROCKSDB_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(rocksdb-includes,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-rocksdb-includes=[[[DIR]]]], [Path to RocksDB include directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
ROCKSDB_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(rocksdb-libs,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-rocksdb-libs=[[[DIR]]]], [Path to RocksDB library directory]),
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
|
|
|
ROCKSDB_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
2016-09-24 06:01:57 +02:00
|
|
|
AC_MSG_CHECKING([whether you asked to use the RocksDB included here])
|
|
|
|
AC_ARG_WITH(included-rocksdb,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-included-rocksdb[[[=version]]]], [Use the RocksDB sources from included submodule]),
|
2016-09-24 06:01:57 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
with_included_rocksdb="yes"
|
|
|
|
|
2020-05-07 05:26:13 +02:00
|
|
|
AC_MSG_NOTICE([Shared RocksDB linkage requires running charybdis with an intact build directory])
|
2019-02-19 22:01:45 +01:00
|
|
|
ROCKSDB_CPPFLAGS="-isystem $PWD/deps/rocksdb/include"
|
|
|
|
ROCKSDB_LDFLAGS="-L$PWD/deps/rocksdb/"
|
2020-05-07 05:23:32 +02:00
|
|
|
ROCKSDB_LDFLAGS+=" -Wl,-rpath=$PWD/deps/rocksdb"
|
|
|
|
ROCKSDB_LIBS="-lrocksdb"
|
2020-05-07 05:26:13 +02:00
|
|
|
|
2020-05-07 05:23:32 +02:00
|
|
|
rocksdb_linkage="shared_lib"
|
2020-05-07 05:26:13 +02:00
|
|
|
rocksdb_version="$withval"
|
2020-05-07 22:25:10 +02:00
|
|
|
if test x"$rocksdb_version" == x"yes"; then
|
2020-05-07 05:26:13 +02:00
|
|
|
rocksdb_version="$ROCKSDB_VERSION_DEFAULT"
|
|
|
|
fi
|
2016-09-24 06:01:57 +02:00
|
|
|
|
2020-05-07 05:26:13 +02:00
|
|
|
bash tools/buildrocks.sh $rocksdb_linkage $rocksdb_version
|
2018-01-28 05:46:41 +01:00
|
|
|
AS_IF([ test $? != 0 ],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Failed to build RocksDB])
|
|
|
|
])
|
2016-09-24 06:01:57 +02:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
with_included_rocksdb="no"
|
|
|
|
|
2020-05-10 04:17:02 +02:00
|
|
|
PKG_CHECK_MODULES(rocksdb, [rocksdb],
|
2019-02-19 22:01:45 +01:00
|
|
|
[
|
2020-04-30 12:22:15 +02:00
|
|
|
ROCKSDB_LIBS="-lrocksdb"
|
|
|
|
], [
|
2020-05-09 00:21:25 +02:00
|
|
|
AC_CHECK_LIB(rocksdb, rocksdb_open,
|
|
|
|
[
|
|
|
|
ROCKSDB_LIBS="-lrocksdb"
|
|
|
|
], [
|
|
|
|
AC_MSG_ERROR([Unable to find required RocksDB package. Try apt-get install librocksdb-dev])
|
|
|
|
])
|
2016-09-24 06:01:57 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2020-10-11 20:44:34 +02:00
|
|
|
dnl Units which include rocksdb headers use these flags.
|
|
|
|
AC_SUBST(ROCKSDB_UNIT_CPPFLAGS)
|
|
|
|
ROCKSDB_UNIT_CPPFLAGS+=" $ROCKSDB_CPPFLAGS"
|
|
|
|
ROCKSDB_UNIT_CPPFLAGS+=" $ZSTD_CPPFLAGS"
|
|
|
|
ROCKSDB_UNIT_CPPFLAGS+=" $SNAPPY_CPPFLAGS"
|
|
|
|
ROCKSDB_UNIT_CPPFLAGS+=" $LZ4_CPPFLAGS"
|
|
|
|
ROCKSDB_UNIT_CPPFLAGS+=" $Z_CPPFLAGS"
|
|
|
|
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-10-11 06:28:16 +02:00
|
|
|
dnl
|
|
|
|
dnl SpiderMonkey support
|
|
|
|
dnl
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-10-11 06:28:16 +02:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether you asked to use the JS engine included here])
|
|
|
|
AC_ARG_WITH(included-js,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-included-js[[[=shared]]]], [Use the JS engine (SpiderMonkey) sources we include here]),
|
2016-10-11 06:28:16 +02:00
|
|
|
[
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
with_included_js="yes"
|
|
|
|
|
|
|
|
AC_SUBST(JS_CPPFLAGS)
|
2018-01-28 05:46:41 +01:00
|
|
|
JS_CPPFLAGS+=" -isystem $PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/include"
|
|
|
|
#JS_CPPFLAGS+=" -I$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/include"
|
2016-10-11 06:28:16 +02:00
|
|
|
|
|
|
|
AC_SUBST(JS_LDFLAGS)
|
2018-01-28 05:46:41 +01:00
|
|
|
JS_LDFLAGS+=" -L$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/sdk/lib"
|
|
|
|
JS_LDFLAGS+=" -L$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/intl/icu/target/lib"
|
|
|
|
JS_LDFLAGS+=" -L$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/js/src"
|
2016-10-11 06:28:16 +02:00
|
|
|
|
|
|
|
AC_SUBST(JS_LIBS)
|
2019-12-26 20:24:42 +01:00
|
|
|
JS_LIBS+=" -lmozjs-68"
|
2017-08-23 23:25:22 +02:00
|
|
|
JS_LIBS+=" -lmozglue"
|
2016-10-11 06:28:16 +02:00
|
|
|
|
|
|
|
dnl !!!!
|
|
|
|
dnl HACK BUG-WORKAROUND - Mozilla forgot to include this in their lib?
|
|
|
|
dnl Runtime segfault (unresolved dynamic function address) if this is not specified
|
2018-01-28 05:46:41 +01:00
|
|
|
#JS_LIBS+=" $PWD/deps/gecko-dev/js/src/build_OPT.OBJ/mfbt/Unified_cpp_mfbt0.o"
|
|
|
|
#JS_LIBS+=" $PWD/deps/gecko-dev/js/src/build_OPT.OBJ/mfbt/Unified_cpp_mfbt1.o"
|
|
|
|
JS_LIBS+=" $PWD/deps/gecko-dev/js/src/build_OPT.OBJ/mozglue/misc/TimeStamp.o"
|
2016-10-11 06:28:16 +02:00
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether to use shared JS engine])
|
|
|
|
if [[ $withval = "shared" ]]; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
AC_MSG_NOTICE([Shared SpiderMonkey linkage requires running charybdis with an intact build directory])
|
|
|
|
js_linkage="shared"
|
2018-01-28 05:46:41 +01:00
|
|
|
JS_LDFLAGS+=" -Wl,-rpath=$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/sdk/lib"
|
|
|
|
JS_LDFLAGS+=" -Wl,-rpath=$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/intl/icu/target/lib"
|
2016-10-11 06:28:16 +02:00
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
js_linkage="static"
|
|
|
|
JS_LIBS+=" -ljs_static"
|
|
|
|
fi
|
|
|
|
|
2019-12-26 20:24:42 +01:00
|
|
|
js_branch="esr68"
|
2016-11-25 03:22:36 +01:00
|
|
|
|
|
|
|
if [[ $DEBUG ]]; then
|
2017-08-23 23:25:22 +02:00
|
|
|
js_options="--disable-optimize --enable-debug --disable-js-shell"
|
2016-11-25 03:22:36 +01:00
|
|
|
else
|
2017-08-23 23:25:22 +02:00
|
|
|
js_options="--enable-optimize --disable-js-shell"
|
2016-11-25 03:22:36 +01:00
|
|
|
fi
|
|
|
|
|
2018-07-03 23:35:10 +02:00
|
|
|
bash tools/buildjs.sh "$js_branch" "$js_options"
|
2016-11-29 16:23:38 +01:00
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([ENABLE_JS], [1], [ Enable JavaScript support. ])
|
|
|
|
RB_DEFINE_UNQUOTED([INC_JSAPI_H], [jsapi.h>], [ SpiderMonkey JavaScript API. ])
|
|
|
|
RB_DEFINE_UNQUOTED([INC_JSFRIENDAPI_H], [jsfriendapi.h>], [ SpiderMonkey JavaScript Extended API. ])
|
|
|
|
RB_DEFINE_UNQUOTED([INC_JS_CONVERSIONS_H], [js/Conversions.h>], [ SpiderMonkey JavaScript Conversions. ])
|
2016-10-11 06:28:16 +02:00
|
|
|
],[
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
with_included_js="no"
|
|
|
|
|
|
|
|
dnl TODO mumble mumble
|
2019-12-26 20:24:42 +01:00
|
|
|
AC_CHECK_LIB(mozjs-68, _Z11JS_ShutDownv,
|
2016-10-11 06:28:16 +02:00
|
|
|
[
|
|
|
|
|
|
|
|
], [
|
2019-12-26 20:24:42 +01:00
|
|
|
AC_MSG_WARN([Unable to find JS engine (SpiderMonkey 68) package. Try apt-get install libmozjs-dev])
|
2016-10-11 06:28:16 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
dnl TODO
|
2019-12-26 20:24:42 +01:00
|
|
|
dnl AC_SUBST(JS_CPPFLAGS, ["-I/usr/include/mozjs-68"])
|
2016-11-29 16:23:38 +01:00
|
|
|
dnl AC_SUBST(JS_LDFLAGS, [])
|
2019-12-26 20:24:42 +01:00
|
|
|
dnl AC_SUBST(JS_LIBS, ["-lmozjs-68"])
|
2016-10-11 06:28:16 +02:00
|
|
|
])
|
|
|
|
|
2016-11-29 16:23:38 +01:00
|
|
|
dnl TODO use an $enable_js var
|
|
|
|
AM_CONDITIONAL([JS], [[[[ $with_included_js = yes ]]]])
|
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Application settings
|
|
|
|
dnl
|
2011-05-08 15:55:32 +02:00
|
|
|
|
2018-08-12 19:16:00 +02:00
|
|
|
dnl
|
|
|
|
dnl --with-mxid-maxlen
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_ARG_WITH(mxid-maxlen,
|
2020-05-09 00:14:44 +02:00
|
|
|
RB_HELP_STRING([--with-mxid-maxlen=LENGTH],[Set the upper-bound mxid length to LENGTH (default 255, max 511)]),
|
2018-08-12 19:16:00 +02:00
|
|
|
[
|
|
|
|
if ! expr "$withval" + 0 >/dev/null 2>&1; then
|
2021-12-20 18:27:47 +01:00
|
|
|
AC_MSG_ERROR(MXID_MAXLEN must be a numeric value)
|
2018-08-12 19:16:00 +02:00
|
|
|
fi
|
|
|
|
if test $withval -gt 511; then
|
|
|
|
MXID_MAXLEN=511
|
|
|
|
AC_MSG_WARN([MXID_MAXLEN has a hard limit of 511. Setting MXID_MAXLEN=511])
|
|
|
|
elif test $withval -lt 4; then
|
|
|
|
MXID_MAXLEN=4
|
|
|
|
AC_MSG_WARN([MXID_MAXLEN has a lower limit of 4. Setting MXID_MAXLEN=4])
|
|
|
|
else
|
|
|
|
MXID_MAXLEN="$withval"
|
|
|
|
fi
|
|
|
|
], [
|
|
|
|
MXID_MAXLEN=255
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_DEFINE_UNQUOTED([MXID_MAXLEN], [$MXID_MAXLEN], [Maximum string length of an MXID (not including null)])
|
|
|
|
|
2020-07-30 15:23:31 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Branding defined in the compilation
|
|
|
|
dnl
|
|
|
|
|
2018-04-03 01:50:51 +02:00
|
|
|
VERSION_COMMIT_CMD="git rev-parse --short HEAD"
|
|
|
|
RB_VERSION_COMMIT=`$VERSION_COMMIT_CMD`
|
|
|
|
RB_DEFINE_UNQUOTED([VERSION_COMMIT], ["$RB_VERSION_COMMIT"], [Git commit at configuration time.])
|
|
|
|
#CPPDEFINE([RB_VERSION_COMMIT], [`$VERSION_COMMIT_CMD`])
|
|
|
|
|
|
|
|
VERSION_BRANCH_CMD="git rev-parse --abbrev-ref HEAD"
|
|
|
|
RB_VERSION_BRANCH=`$VERSION_BRANCH_CMD`
|
|
|
|
RB_DEFINE_UNQUOTED([VERSION_BRANCH], ["$RB_VERSION_BRANCH"], [Git branch at configuration time.])
|
|
|
|
#CPPDEFINE([RB_VERSION_BRANCH], [`$VERSION_BRANCH_CMD`])
|
|
|
|
|
2020-04-20 04:56:09 +02:00
|
|
|
VERSION_TAG_CMD="git describe --tags --abbrev=0 --dirty --always --broken"
|
2018-04-03 01:50:51 +02:00
|
|
|
RB_VERSION_TAG=`$VERSION_TAG_CMD`
|
|
|
|
RB_DEFINE_UNQUOTED([VERSION_TAG], ["$RB_VERSION_TAG"], [Git tag at configuration time.])
|
|
|
|
#CPPDEFINE([RB_VERSION_TAG], [`$VERSION_TAG_CMD`])
|
|
|
|
|
2020-04-20 04:56:09 +02:00
|
|
|
VERSION_CMD="git describe --tags --always --broken"
|
2016-07-20 20:55:46 +02:00
|
|
|
RB_VERSION=`$VERSION_CMD`
|
|
|
|
RB_DEFINE_UNQUOTED([VERSION], ["$RB_VERSION"], [Version generated at configuration time.])
|
|
|
|
|
2016-07-31 03:00:19 +02:00
|
|
|
DATESTR_CMD="date"
|
2016-07-20 20:55:46 +02:00
|
|
|
RB_DATESTR=`$DATESTR_CMD`
|
|
|
|
RB_DEFINE_UNQUOTED([DATESTR], ["$RB_DATESTR"], [Readable date string of configuration time.])
|
|
|
|
|
|
|
|
DATECODE_CMD="date +%s"
|
|
|
|
RB_DATECODE=`$DATECODE_CMD`
|
2019-06-13 22:33:22 +02:00
|
|
|
RB_DEFINE_UNQUOTED([TIME_CONFIGURED], [$RB_DATECODE], [UNIX epoch time at configuration time.])
|
2016-08-16 00:26:38 +02:00
|
|
|
RB_DEFINE_UNQUOTED([DATE_CONFIGURED], ["$RB_DATESTR"], [Convenience string of RB_TIME_CONFIGURED])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
dnl --with-custom-branding
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([whether custom branding is requested])
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_WITH(custom-branding, RB_HELP_STRING([--with-custom-branding=NAME], [Custom branding name]),
|
2007-01-25 07:40:21 +01:00
|
|
|
[
|
2020-04-20 04:45:27 +02:00
|
|
|
BRANDING_NAME="$withval"
|
|
|
|
AC_DEFINE_UNQUOTED(BRANDING_NAME, ["$BRANDING_NAME"], [Custom branding name.])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_DEFINE(CUSTOM_BRANDING, 1, [Define if custom branding is enabled.])
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
],[
|
2020-04-20 04:45:27 +02:00
|
|
|
BRANDING_NAME="$PACKAGE_NAME"
|
|
|
|
AC_DEFINE_UNQUOTED(BRANDING_NAME, ["$BRANDING_NAME"], [Current package])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl
|
|
|
|
dnl --with-custom-version
|
|
|
|
dnl
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_CHECKING([whether a custom version is requested])
|
2020-05-10 02:42:22 +02:00
|
|
|
AC_ARG_WITH(custom-version, RB_HELP_STRING([--with-custom-version=NAME], [Custom version branding]),
|
2016-07-20 20:55:46 +02:00
|
|
|
[
|
2020-04-20 04:45:27 +02:00
|
|
|
BRANDING_VERSION="$withval"
|
|
|
|
AC_DEFINE_UNQUOTED(BRANDING_VERSION, ["$BRANDING_VERSION"], [Custom branding version.])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
], [
|
2020-04-20 04:45:27 +02:00
|
|
|
BRANDING_VERSION="$RB_VERSION"
|
|
|
|
AC_DEFINE_UNQUOTED(BRANDING_VERSION, ["$BRANDING_VERSION"], [Current version])
|
2016-07-20 20:55:46 +02:00
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
2007-01-25 07:40:21 +01:00
|
|
|
|
2019-09-26 05:30:26 +02:00
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl ***************************************************************************
|
2018-08-12 18:54:44 +02:00
|
|
|
dnl
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Output
|
|
|
|
dnl
|
2016-02-06 23:17:48 +01:00
|
|
|
|
2007-01-25 07:40:21 +01:00
|
|
|
AC_OUTPUT
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
dnl Make it look sexay!
|
|
|
|
echo
|
2020-07-12 20:48:48 +02:00
|
|
|
echo "Configured ........................ $PACKAGE_NAME $PACKAGE_VERSION"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "Configured time ................... $RB_DATESTR"
|
|
|
|
echo
|
2020-02-04 06:42:10 +01:00
|
|
|
echo "C++ Compiler ...................... $CXX"
|
|
|
|
echo "C++ Compiler flags (CXXFLAGS) ..... $CXXFLAGS"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo
|
2019-09-26 05:30:26 +02:00
|
|
|
echo "Linker ............................ $LD"
|
|
|
|
echo "Linker flags (LDFLAGS) ............ $LDFLAGS"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo
|
|
|
|
echo "Target platform (host) ............ $host_cpu $host_vendor $host_os"
|
2020-07-12 20:48:48 +02:00
|
|
|
echo "Developer platform (build) ........ $build_cpu $build_vendor $build_os"
|
2019-09-26 05:30:26 +02:00
|
|
|
echo "Developer debug ................... $debug"
|
|
|
|
echo "Developer assert .................. $assert ($assert_type)"
|
2020-04-17 05:28:10 +02:00
|
|
|
echo "Developer profiling ............... $profiling"
|
2019-09-26 05:30:26 +02:00
|
|
|
echo "Precompiled headers ............... $build_pch"
|
|
|
|
echo "Optimized compile ................. $optimize"
|
|
|
|
echo "Optimized linking ................. $lto"
|
2020-11-24 20:04:19 +01:00
|
|
|
echo "Optimized runtime ................. $profiling_used"
|
2019-09-26 05:30:26 +02:00
|
|
|
echo "Optimization level ................ $optimize_level"
|
|
|
|
echo "Machine tuned ..................... $machine_tuning"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo
|
|
|
|
echo "Magic support ..................... $have_magic"
|
2021-01-16 01:13:56 +01:00
|
|
|
echo "ImageMagick support ............... $have_imagemagick"
|
|
|
|
echo "PNG support ....................... $have_png"
|
2020-09-22 01:20:23 +02:00
|
|
|
echo "Unicode (icuuc) support ........... $have_icuuc"
|
2019-02-19 22:01:45 +01:00
|
|
|
echo "Ziplinks (libz) support ........... $have_zlib"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "Zstandard (zstd) support .......... $have_zstd"
|
2019-02-19 22:01:45 +01:00
|
|
|
echo "Snappy support .................... $have_snappy"
|
2020-09-22 01:20:23 +02:00
|
|
|
echo "LZ4 support ....................... $have_lz4"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "SSL support ....................... $have_ssl"
|
2020-02-04 04:28:45 +01:00
|
|
|
echo "Crypto support .................... $have_crypto"
|
2017-10-01 04:14:45 +02:00
|
|
|
echo "Sodium support .................... $have_sodium"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "GNU MP support .................... $have_gmp"
|
2020-02-04 04:28:45 +01:00
|
|
|
echo "PBC support ....................... $have_pbc"
|
2020-02-03 20:43:58 +01:00
|
|
|
echo "LLVM library support .............. $have_libllvm"
|
2022-04-10 20:16:47 +02:00
|
|
|
echo "DRM support ....................... $have_drm"
|
2021-03-13 23:39:45 +01:00
|
|
|
echo "ARM NN support .................... $have_armnn"
|
2021-01-16 02:15:49 +01:00
|
|
|
echo "OpenCL support .................... $have_opencl"
|
2020-10-08 00:41:32 +02:00
|
|
|
echo "MesaOpenCL support ................ $have_mesa_opencl"
|
2018-05-16 21:36:31 +02:00
|
|
|
echo "Linux AIO support ................. $aio"
|
2019-08-11 07:06:08 +02:00
|
|
|
echo "Linux io_uring support ............ $io_uring"
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "Memory allocator .................. $alloc_lib"
|
|
|
|
echo
|
|
|
|
echo "Using bundled Boost ............... $with_included_boost"
|
|
|
|
echo "Using bundled RocksDB ............. $with_included_rocksdb"
|
|
|
|
echo
|
2021-12-20 18:27:47 +01:00
|
|
|
echo "Install prefix .................... $prefix"
|
|
|
|
echo "Binary prefix .................... $bindir"
|
|
|
|
echo "Config prefix ..................... $sysconfdir"
|
|
|
|
echo "Include prefix .................... $includedir"
|
|
|
|
echo "Library prefix .................... $libdir"
|
|
|
|
echo "Shared prefix ..................... $datarootdir"
|
|
|
|
echo
|
|
|
|
echo "Runstate directory ................ $runstatedir"
|
2020-04-19 06:00:07 +02:00
|
|
|
echo "Database directory ................ $dbdir"
|
|
|
|
echo "Logging directory ................. $logdir"
|
2021-12-20 18:27:47 +01:00
|
|
|
echo "Modules directory ................. $moduledir"
|
|
|
|
echo "Shared directory .................. $datadir"
|
|
|
|
echo "Webapp directory .................. $webappdir"
|
2016-07-01 05:04:00 +02:00
|
|
|
echo
|
2020-09-22 01:51:35 +02:00
|
|
|
echo "Matrix ID (mxid) length ........... $MXID_MAXLEN"
|
|
|
|
echo "Logging level ..................... $LOG_LEVEL"
|
|
|
|
echo "Branding .......................... $BRANDING_NAME $BRANDING_VERSION"
|
|
|
|
echo
|
2016-07-20 20:55:46 +02:00
|
|
|
echo "* Ready to build $PACKAGE_NAME"
|
|
|
|
echo "* Now run 'make'"
|