2020-05-08 23:45:08 +02:00
|
|
|
AC_PREREQ([2.63])
|
2016-07-25 02:33:26 +02:00
|
|
|
AUTOMAKE_OPTIONS = 1.11
|
2022-08-20 19:15:49 +02: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 ]]]])
|
2023-01-15 07:53:17 +01:00
|
|
|
|
2020-09-15 02:17:13 +02:00
|
|
|
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 ]]]])
|
2023-01-15 07:53:17 +01:00
|
|
|
AM_CONDITIONAL([CLANG15], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 15 ]]]])
|
|
|
|
AM_CONDITIONAL([CLANG16], [[[[ $CXX = clang* ]] && [[ $CXX_EPOCH -ge 16 ]]]])
|
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
|
|
|
|
|
2022-07-16 22:09:14 +02:00
|
|
|
if [[ "$assert_type" == "opt" ]]; then
|
|
|
|
RB_DEFINE([ASSERT_OPTIMISTIC], [1], [Optimistic 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)
|
2021-04-09 15:16:28 +02:00
|
|
|
AC_ARG_ENABLE(lto, RB_HELP_STRING([--enable-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 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" ]]]])
|
2022-07-19 21:38:10 +02:00
|
|
|
AM_CONDITIONAL([CLANG_PCH], [[[[ "$build_pch" = "yes" ]] && [[ $CXX = clang* ]]]])
|
2016-07-24 03:42:24 +02:00
|
|
|
|
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
|
|
|
|
2022-06-21 05:02:21 +02:00
|
|
|
dnl
|
|
|
|
dnl GCC toolchain selection (for clang)
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to use a specific GCC toolchain)
|
|
|
|
AC_ARG_WITH(gcc-toolchain, RB_HELP_STRING([--with-gcc-toolchain], [Path to GCC toolchain]),
|
|
|
|
[
|
|
|
|
with_gcc_toolchain=$withval
|
|
|
|
AC_MSG_RESULT([yes, "$with_gcc_toolchain"])
|
|
|
|
AC_SUBST(GCC_TOOLCHAIN, $with_gcc_toolchain)
|
|
|
|
AM_COND_IF(CLANG,
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["--gcc-toolchain=$with_gcc_toolchain"])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["--gcc-toolchain=$with_gcc_toolchain"])
|
|
|
|
], [
|
|
|
|
AC_MSG_WARN([--with-gcc-toolchain only applies to clang builds.])
|
|
|
|
])
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
])
|
|
|
|
|
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"])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2022-07-19 20:54:28 +02:00
|
|
|
AM_COND_IF([BUILD_PCH],
|
|
|
|
[
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fpch-deps"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CPPFLAGS], ["-fpch-preprocess"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF([CLANG10],
|
|
|
|
[
|
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["-fpch-validate-input-files-content"])
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2021-11-11 04:52:13 +01:00
|
|
|
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
|
|
|
|
|
2022-07-27 21:40:22 +02:00
|
|
|
TUNE_FLAGS=""
|
2020-07-12 20:48:48 +02:00
|
|
|
AM_COND_IF([UNTUNED],
|
|
|
|
[
|
|
|
|
machine_tuning="generic ${host_cpu} and untuned"
|
2022-07-27 21:40:22 +02:00
|
|
|
RB_VAR_PREPEND([TUNE_FLAGS], ["-mno-default"])
|
2020-07-12 20:48:48 +02:00
|
|
|
], [
|
|
|
|
AM_COND_IF([GENERIC],
|
|
|
|
[
|
2022-07-27 21:40:22 +02:00
|
|
|
machine_tuning="generic ${host_cpu}"
|
|
|
|
RB_VAR_PREPEND([TUNE_FLAGS], ["-mtune=generic"])
|
2020-07-12 20:48:48 +02:00
|
|
|
], [
|
2022-07-27 21:40:22 +02:00
|
|
|
machine_tuning="${host_cpu} native"
|
2020-07-12 20:48:48 +02:00
|
|
|
|
|
|
|
AS_CASE([$host_cpu],
|
|
|
|
[x86_64],
|
|
|
|
[
|
2020-10-02 01:25:23 +02:00
|
|
|
dnl AMD K10's SSE4a doesn't work with valgrind
|
2022-07-27 21:40:22 +02:00
|
|
|
RB_VAR_PREPEND([TUNE_FLAGS], ["-mno-sse4a"])
|
2020-10-02 04:50:06 +02:00
|
|
|
|
|
|
|
dnl Not accepted by clang on aarch64
|
2022-07-27 21:40:22 +02:00
|
|
|
RB_VAR_PREPEND([TUNE_FLAGS], ["-march=native"])
|
2020-07-12 20:48:48 +02:00
|
|
|
])
|
2020-10-02 04:50:06 +02:00
|
|
|
|
2022-07-27 21:40:22 +02:00
|
|
|
RB_VAR_PREPEND([TUNE_FLAGS], ["-mtune=native"])
|
2020-07-12 20:48:48 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2022-07-27 21:40:22 +02:00
|
|
|
RB_VAR_PREPEND([CXXFLAGS], ["$TUNE_FLAGS"])
|
|
|
|
|
|
|
|
dnl Get the target features for this build from gcc into a readable string
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
|
|
|
_cxx=$(echo "${CXX}" | cut -d' ' -f1)
|
|
|
|
_cmd="${_cxx} -Q --help=target ${TUNE_FLAGS}"
|
|
|
|
machine_features=$(${_cmd} | grep enabled | grep -v 'mno-')
|
|
|
|
machine_features=$(printf "\n${machine_features}")
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Get the target features for this build from clang into a readable string
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
|
|
|
_flag=0
|
|
|
|
_cxx=$(echo "${CXX}" | cut -d' ' -f1)
|
|
|
|
_str=$(${_cxx} -E ${TUNE_FLAGS} - -### 2>&1)
|
|
|
|
machine_features=""
|
|
|
|
for i in $_str; do
|
|
|
|
if [[ $i == '"-target-feature"' ]]; then
|
|
|
|
_flag=1
|
|
|
|
elif [[ $_flag == 1 ]]; then
|
|
|
|
_flag=0
|
|
|
|
attr=$(echo $i | sed -e 's/^"//' -e 's/"$//')
|
|
|
|
if [[ ${attr:0:1} == '+' ]]; then
|
|
|
|
machine_features="${machine_features}${attr} "
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
])
|
|
|
|
|
2017-09-30 08:00:16 +02:00
|
|
|
dnl
|
|
|
|
dnl Compiler warnings
|
|
|
|
dnl
|
|
|
|
|
2022-07-27 19:47:24 +02:00
|
|
|
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([$enableval])
|
|
|
|
warnings="$enableval"
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
warnings="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFUN([RB_MAYBE_CWARN],
|
|
|
|
[
|
|
|
|
if test x"$warnings" == x"yes"; then
|
|
|
|
RB_MAYBE_CXXFLAG([$1], [$2])
|
|
|
|
fi
|
|
|
|
])
|
|
|
|
|
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-07-27 19:47:24 +02:00
|
|
|
dnl Compatible warnings
|
|
|
|
RB_MAYBE_CWARN([-Wall], charybdis_cv_c_gcc_w_all)
|
|
|
|
RB_MAYBE_CWARN([-Wextra], charybdis_cv_c_gcc_w_extra)
|
|
|
|
RB_MAYBE_CWARN([-Wpointer-arith], charybdis_cv_c_gcc_w_pointer_arith)
|
|
|
|
RB_MAYBE_CWARN([-Wcast-align], charybdis_cv_c_gcc_w_cast_align)
|
|
|
|
RB_MAYBE_CWARN([-Wcast-qual], charybdis_cv_c_gcc_w_cast_qual)
|
|
|
|
RB_MAYBE_CWARN([-Wfloat-equal], charybdis_cv_c_gcc_w_float_equal)
|
|
|
|
RB_MAYBE_CWARN([-Wwrite-strings], charybdis_cv_c_gcc_w_write_strings)
|
|
|
|
RB_MAYBE_CWARN([-Wparentheses], charybdis_cv_c_gcc_parentheses)
|
|
|
|
RB_MAYBE_CWARN([-Wundef], charybdis_cv_c_gcc_w_undef)
|
|
|
|
RB_MAYBE_CWARN([-Wpacked], charybdis_cv_c_gcc_w_packed)
|
|
|
|
RB_MAYBE_CWARN([-Wformat -Wformat-y2k -Wformat-nonliteral], charybdis_cv_c_gcc_w_format)
|
|
|
|
RB_MAYBE_CWARN([-Wstrict-aliasing=2 -Wstrict-overflow=5], charybdis_cv_c_gcc_w_strict)
|
|
|
|
RB_MAYBE_CWARN([-Wdisabled-optimization], charybdis_cv_c_gcc_w_disabled_optimization)
|
|
|
|
RB_MAYBE_CWARN([-Winvalid-pch], charybdis_cv_c_gcc_w_invalid_pch)
|
|
|
|
RB_MAYBE_CWARN([-Winit-self], charybdis_cv_c_gcc_w_init_self)
|
|
|
|
RB_MAYBE_CWARN([-Wuninitialized], charybdis_cv_c_gcc_w_uninitialized)
|
|
|
|
RB_MAYBE_CWARN([-Wunreachable-code], charybdis_cv_c_gcc_w_unreachable_code)
|
|
|
|
RB_MAYBE_CWARN([-Wno-overloaded-virtual], charybdis_cv_c_gcc_w_overloaded_virtual)
|
|
|
|
RB_MAYBE_CWARN([-Wnon-virtual-dtor], charybdis_cv_c_gcc_w_non_virtual_dtor)
|
|
|
|
RB_MAYBE_CWARN([-Wnoexcept], charybdis_cv_c_gcc_w_noexcept)
|
|
|
|
RB_MAYBE_CWARN([-Wsized-deallocation], charybdis_cv_c_gcc_w_sized_deallocation)
|
|
|
|
RB_MAYBE_CWARN([-Wctor-dtor-privacy], charybdis_cv_c_gcc_w_ctor_dtor_privacy)
|
|
|
|
RB_MAYBE_CWARN([-Wsign-promo], charybdis_cv_c_gcc_w_sign_promo)
|
|
|
|
RB_MAYBE_CWARN([-Wtrampolines], charybdis_cv_c_gcc_w_trampolines)
|
|
|
|
RB_MAYBE_CWARN([-Wduplicated-cond], charybdis_cv_c_gcc_w_duplicated_cond)
|
|
|
|
RB_MAYBE_CWARN([-Wduplicate-branches], charybdis_cv_c_gcc_w_duplicate_branches)
|
|
|
|
RB_MAYBE_CWARN([-Wrestrict], charybdis_cv_c_gcc_w_restrict)
|
|
|
|
RB_MAYBE_CWARN([-Wnull-dereference], charybdis_cv_c_gcc_w_null_dereference)
|
|
|
|
RB_MAYBE_CWARN([-Wplacement-new=2], charybdis_cv_c_gcc_w_placement_new)
|
|
|
|
RB_MAYBE_CWARN([-Wundef], charybdis_cv_c_gcc_w_undef)
|
|
|
|
RB_MAYBE_CWARN([-Wodr], charybdis_cv_c_gcc_w_odr)
|
2023-02-02 19:56:43 +01:00
|
|
|
RB_MAYBE_CWARN([-Wimplicit-fallthrough], charybdis_cv_c_gcc_w_implicit_fallthrough)
|
2022-07-27 19:47:24 +02:00
|
|
|
|
|
|
|
RB_MAYBE_CWARN([-Werror=return-type], charybdis_cv_c_gcc_w_error_return_type)
|
|
|
|
|
|
|
|
dnl Compiler specific
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2022-07-27 19:52:56 +02:00
|
|
|
RB_MAYBE_CWARN([-Werror=return-local-addr], charybdis_cv_c_gcc_w_error_return_local_addr)
|
|
|
|
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wlogical-op], charybdis_cv_c_gcc_w_logical_op)
|
|
|
|
RB_MAYBE_CWARN([-Wformat-security], charybdis_cv_c_gcc_w_format_security)
|
|
|
|
RB_MAYBE_CWARN([-Wstack-usage=$STACK_USAGE_WARNING], charybdis_cv_c_gcc_w_stack_usage)
|
|
|
|
RB_MAYBE_CWARN([-Wframe-larger-than=$FRAME_SIZE_WARNING], charybdis_cv_c_gcc_w_frame_larger_than)
|
|
|
|
RB_MAYBE_CWARN([-Walloca], charybdis_cv_c_gcc_w_alloca)
|
|
|
|
RB_MAYBE_CWARN([-Wvector-operation-performance], charybdis_cv_c_gcc_w_vector_operation_performance)
|
2023-01-16 02:14:46 +01:00
|
|
|
RB_MAYBE_CWARN([-Wstringop-overflow=4], charybdis_cv_c_gcc_w_stringop_overflow)
|
2022-07-27 19:47:24 +02:00
|
|
|
|
|
|
|
AM_COND_IF([DEBUG],
|
|
|
|
[
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-attribute=format], charybdis_cv_c_gcc_w_suggest_attribute_format)
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-attribute=noreturn], charybdis_cv_c_gcc_w_suggest_attribute_noreturn)
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-attribute=malloc], charybdis_cv_c_gcc_w_suggest_attribute_malloc)
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-attribute=cold], charybdis_cv_c_gcc_w_suggest_attribute_cold)
|
|
|
|
dnl RB_MAYBE_CWARN([-Wsuggest-attribute=pure], charybdis_cv_c_gcc_w_suggest_attribute_pure)
|
|
|
|
dnl RB_MAYBE_CWARN([-Wsuggest-attribute=const], charybdis_cv_c_gcc_w_suggest_attribute_const)
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl Compiler specific
|
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2022-07-27 19:52:56 +02:00
|
|
|
RB_MAYBE_CWARN([-Werror=return-stack-address], charybdis_cv_c_gcc_w_error_return_stack_address)
|
|
|
|
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wundefined-reinterpret-cast], charybdis_cv_c_gcc_w_undefined_reinterpret_cast)
|
|
|
|
RB_MAYBE_CWARN([-Wconditional-uninitialized], charybdis_cv_c_gcc_w_conditional_uninitialized)
|
|
|
|
|
|
|
|
RB_MAYBE_CWARN([-Wno-mismatched-tags], charybdis_cv_c_gcc_w_mismatched_tags)
|
|
|
|
RB_MAYBE_CWARN([-Wno-format-security], charybdis_cv_c_gcc_w_format_security)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unknown-warning-option], charybdis_cv_c_gcc_w_unknown_warning_option)
|
|
|
|
RB_MAYBE_CWARN([-Wno-profile-instr-unprofiled], charybdis_cv_c_gcc_w_profile_instr_unprofiled)
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl
|
|
|
|
dnl Warnings we suppress:
|
2017-10-25 18:11:21 +02:00
|
|
|
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-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-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-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-unused], charybdis_cv_c_gcc_w_unused)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unused-function], charybdis_cv_c_gcc_w_unused_function)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unused-label], charybdis_cv_c_gcc_w_unused_label)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unused-value], charybdis_cv_c_gcc_w_unused_value)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unused-variable], charybdis_cv_c_gcc_w_unused_variable)
|
|
|
|
RB_MAYBE_CWARN([-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-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-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-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wsuggest-final-types], charybdis_cv_c_gcc_w_suggest_final_types)
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-final-methods], charybdis_cv_c_gcc_w_suggest_final_methods)
|
|
|
|
RB_MAYBE_CWARN([-Wsuggest-override], charybdis_cv_c_gcc_w_suggest_override)
|
|
|
|
RB_MAYBE_CWARN([-Wmissing-noreturn], charybdis_cv_c_gcc_w_missing_noreturn)
|
2020-07-25 17:28:42 +02:00
|
|
|
], [
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-unknown-pragmas], charybdis_cv_c_gcc_w_no_unknown_pragmas)
|
2020-11-28 04:52:22 +01:00
|
|
|
|
2020-08-09 17:19:18 +02:00
|
|
|
AM_COND_IF([CLANG],
|
|
|
|
[
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-unknown-attributes], charybdis_cv_c_gcc_w_no_unknown_attributes)
|
2020-08-09 17:19:18 +02:00
|
|
|
])
|
2020-11-28 04:52:22 +01:00
|
|
|
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-ignored-attributes], charybdis_cv_c_gcc_w_no_ignored_attributes)
|
|
|
|
RB_MAYBE_CWARN([-Wno-attributes], charybdis_cv_c_gcc_w_no_attributes)
|
|
|
|
RB_MAYBE_CWARN([-Wno-pragmas], charybdis_cv_c_gcc_w_no_pragmas)
|
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
|
|
|
|
|
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)]),
|
|
|
|
[
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Weverything], charybdis_cv_c_gcc_w_everything)
|
2022-06-14 03:00:27 +02:00
|
|
|
|
|
|
|
dnl Ignored a priori
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-c++98-compat], charybdis_cv_c_gcc_w_no_cxx98_compat)
|
|
|
|
RB_MAYBE_CWARN([-Wno-c++98-compat-pedantic], charybdis_cv_c_gcc_w_no_cxx98_compat_pedantic)
|
|
|
|
RB_MAYBE_CWARN([-Wno-c++98-compat-extra-semi], charybdis_cv_c_gcc_w_no_cxx98_compat_extra_semi)
|
|
|
|
RB_MAYBE_CWARN([-Wno-pre-c++14-compat], charybdis_cv_c_gcc_w_no_pre_cxx14_compat)
|
|
|
|
RB_MAYBE_CWARN([-Wno-pre-c++17-compat], charybdis_cv_c_gcc_w_no_pre_cxx17_compat)
|
2022-06-14 03:00:27 +02:00
|
|
|
|
|
|
|
dnl Ignored by design
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-comma], charybdis_cv_c_gcc_w_no_comma)
|
|
|
|
RB_MAYBE_CWARN([-Wno-shadow], charybdis_cv_c_gcc_w_no_shadow)
|
|
|
|
RB_MAYBE_CWARN([-Wno-shadow-field], charybdis_cv_c_gcc_w_no_shadow_field)
|
|
|
|
RB_MAYBE_CWARN([-Wno-shadow-field-in-constructor], charybdis_cv_c_gcc_w_no_shadow_field_in_constructor)
|
|
|
|
RB_MAYBE_CWARN([-Wno-shadow-uncaptured-local], charybdis_cv_c_gcc_w_no_shadow_uncaptured_local)
|
|
|
|
RB_MAYBE_CWARN([-Wno-gnu-conditional-omitted-operand], charybdis_cv_c_gcc_w_no_gnu_conditional_omitted_operand)
|
|
|
|
RB_MAYBE_CWARN([-Wno-ctad-maybe-unsupported], charybdis_cv_c_gcc_w_no_ctad_maybe_unsupported)
|
|
|
|
RB_MAYBE_CWARN([-Wno-disabled-macro-expansion], charybdis_cv_c_gcc_w_no_disabled_macro_expansion)
|
2022-06-14 03:00:27 +02:00
|
|
|
|
|
|
|
dnl Ignored for now
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-padded], charybdis_cv_c_gcc_w_no_padded)
|
|
|
|
RB_MAYBE_CWARN([-Wno-sign-conversion], charybdis_cv_c_gcc_w_no_sign_conversion)
|
|
|
|
RB_MAYBE_CWARN([-Wno-unused-exception-parameter], charybdis_cv_c_gcc_w_no_unused_exception_parameter)
|
|
|
|
RB_MAYBE_CWARN([-Wno-extra-semi], charybdis_cv_c_gcc_w_no_extra_semi)
|
|
|
|
RB_MAYBE_CWARN([-Wno-extra-semi-stmt], charybdis_cv_c_gcc_w_no_extra_semi_stmt)
|
|
|
|
RB_MAYBE_CWARN([-Wno-weak-vtables], charybdis_cv_c_gcc_w_no_weak_vtables)
|
|
|
|
RB_MAYBE_CWARN([-Wno-global-constructors], charybdis_cv_c_gcc_w_no_global_constructors)
|
|
|
|
RB_MAYBE_CWARN([-Wno-dtor-name], charybdis_cv_c_gcc_w_no_dtor_name)
|
2022-06-14 03:00:27 +02:00
|
|
|
|
|
|
|
dnl Ignored with issue low priority
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-old-style-cast], charybdis_cv_c_gcc_w_no_old_style_cast)
|
|
|
|
RB_MAYBE_CWARN([-Wno-float-conversion], charybdis_cv_c_gcc_w_no_implicit_int_conversion)
|
|
|
|
RB_MAYBE_CWARN([-Wno-implicit-int-conversion], charybdis_cv_c_gcc_w_no_implicit_int_conversion)
|
2022-06-14 03:00:27 +02:00
|
|
|
|
|
|
|
dnl Ignored with issue high priority
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-reserved-identifier], charybdis_cv_c_gcc_w_no_reserved_identifier)
|
|
|
|
RB_MAYBE_CWARN([-Wno-reserved-macro-identifier], charybdis_cv_c_gcc_w_no_reserved_macro_identifier)
|
2022-06-14 03:00:27 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AM_COND_IF_NOT([UNTUNED],
|
|
|
|
[
|
|
|
|
dnl When tuning for a specific target ignore the ABI compat warnings
|
2022-07-27 19:47:24 +02:00
|
|
|
RB_MAYBE_CWARN([-Wno-psabi], charybdis_cv_c_gcc_w_psabi)
|
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"])
|
2022-07-08 01:40:11 +02:00
|
|
|
RB_VAR_PREPEND([LDFLAGS], ["-Wl,-z,keep-text-section-prefix"])
|
2021-11-11 04:52:13 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
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_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])
|
2022-06-21 04:10:00 +02:00
|
|
|
RB_CHK_SYSHEADER(tuple, [TUPLE])
|
2018-01-10 09:46:13 +01:00
|
|
|
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])
|
2022-06-21 04:10:00 +02:00
|
|
|
RB_CHK_SYSHEADER(concepts, [CONCEPTS])
|
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
|
2022-08-20 20:30:09 +02:00
|
|
|
RB_CHK_SYSHEADER(asm/prctl.h, [ASM_PRCTL_H])
|
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])
|
2022-07-08 01:44:42 +02:00
|
|
|
RB_CHK_SYSHEADER(linux/bpf.h, [LINUX_BPF_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 \
|
2022-06-21 02:51:46 +02:00
|
|
|
mallinfo \
|
|
|
|
mallinfo2 \
|
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 \
|
2022-09-05 06:14:17 +02:00
|
|
|
sync \
|
|
|
|
syncfs \
|
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
|
|
|
|
])
|
2022-09-04 20:08:05 +02:00
|
|
|
])
|
2018-01-11 06:30:31 +01:00
|
|
|
|
2022-09-04 20:08:05 +02:00
|
|
|
AM_CONDITIONAL([AIO], [test "x$aio" = "xyes" ])
|
2018-01-10 01:48:05 +01:00
|
|
|
|
2022-09-04 20:08:05 +02:00
|
|
|
AM_COND_IF([AIO],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_AIO, [1], [Linux AIO is enabled and may be used])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_AIO, [0], [Linux AIO is disabled and will not be used])
|
|
|
|
])
|
2018-02-06 07:42:40 +01:00
|
|
|
|
2019-08-11 07:06:08 +02:00
|
|
|
dnl
|
|
|
|
dnl Linux io_uring support
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AM_COND_IF(LINUX,
|
|
|
|
[
|
2022-09-04 20:08:05 +02:00
|
|
|
AC_ARG_ENABLE(iou, RB_HELP_STRING([--disable-iou], [Disable kernel io_uring support]),
|
2019-08-11 07:06:08 +02:00
|
|
|
[
|
2022-09-04 20:08:05 +02:00
|
|
|
iou=$enableval
|
2019-08-11 07:06:08 +02:00
|
|
|
], [
|
2022-09-04 20:08:05 +02:00
|
|
|
iou=yes
|
2019-08-11 07:06:08 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
2022-09-04 20:08:05 +02:00
|
|
|
AM_CONDITIONAL([IOU], [test "x$iou" = "xyes" ])
|
2019-08-11 07:06:08 +02:00
|
|
|
|
|
|
|
AM_COND_IF([IOU],
|
|
|
|
[
|
2022-09-04 20:08:05 +02:00
|
|
|
IRCD_DEFINE(USE_IOU, [1], [Linux io_uring is enabled for use if available])
|
2022-06-23 03:59:33 +02:00
|
|
|
], [
|
2022-09-04 20:08:05 +02:00
|
|
|
IRCD_DEFINE(USE_IOU, [0], [Linux io_uring is disabled and will not be used])
|
2019-08-11 07:06:08 +02:00
|
|
|
])
|
|
|
|
|
2016-07-20 20:55:46 +02:00
|
|
|
|
|
|
|
dnl ***************************************************************************
|
2022-08-11 22:26:28 +02:00
|
|
|
dnl
|
|
|
|
dnl Installation
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_PATH_PROGS_FEATURE_CHECK([INSTALL], [install],
|
|
|
|
[
|
2022-08-15 02:25:39 +02:00
|
|
|
$ac_path_INSTALL -C --version > /dev/null 2>&1 \
|
2022-08-11 22:26:28 +02:00
|
|
|
&& ac_cv_path_INSTALL="$ac_path_INSTALL -C"
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([if any install supports the -C flag])
|
|
|
|
if test -n "$ac_cv_path_INSTALL"; then
|
|
|
|
AC_MSG_RESULT([yes])
|
|
|
|
INSTALL=$ac_cv_path_INSTALL
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
AC_MSG_WARN([Application should not be running during make install.])
|
|
|
|
AC_PATH_PROG(INSTALL, install)
|
|
|
|
fi
|
|
|
|
|
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]),
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ICU_CPPFLAGS], ["-isystem $withval"])
|
2020-06-19 09:05:23 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(icu-libs,
|
|
|
|
RB_HELP_STRING([--with-icu-libs=[[[DIR]]]], [Path to unicode libraries directory]),
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ICU_LDFLAGS], ["-L$withval"])
|
2020-06-19 09:05:23 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
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"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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
|
|
|
|
2022-06-23 03:59:33 +02:00
|
|
|
AM_COND_IF(ICU,
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_ICU, [1], [International Components for Unicode is available])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_ICU, [0], [International Components for Unicode is not available])
|
|
|
|
])
|
|
|
|
|
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
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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])
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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]),
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([PNG_CPPFLAGS], ["-I$withval"])
|
2021-01-16 01:13:56 +01:00
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(png-libs,
|
|
|
|
RB_HELP_STRING([--with-png-libs=[[[DIR]]]], [Path to PNG library directory]),
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([PNG_LDFLAGS], ["-L$withval"])
|
2021-01-16 01:13:56 +01:00
|
|
|
], [])
|
|
|
|
|
|
|
|
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.
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([PNG_LIBS], ["-lpng"])
|
2021-01-16 01:13:56 +01:00
|
|
|
have_png="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([png], [png_access_version_number],
|
|
|
|
[
|
|
|
|
have_png="yes"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([PNG_LIBS], ["-lpng"])
|
2021-01-16 01:13:56 +01:00
|
|
|
], [
|
|
|
|
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
|
|
|
|
|
2022-07-25 03:31:54 +02:00
|
|
|
AC_SUBST(IMAGEMAGICK_CPPFLAGS)
|
|
|
|
AC_SUBST(IMAGEMAGICK_LDFLAGS)
|
|
|
|
AC_SUBST(IMAGEMAGICK_LIBS)
|
2019-05-29 03:12:28 +02:00
|
|
|
|
|
|
|
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
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_CPPFLAGS], ["-I$withval"])
|
2019-05-29 03:12:28 +02:00
|
|
|
], [
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_CPPFLAGS], [-isystem /usr/include/GraphicsMagick/])
|
2019-05-29 03:12:28 +02:00
|
|
|
])
|
|
|
|
|
|
|
|
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
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_LDFLAGS], ["-L$withval"])
|
2019-05-29 03:12:28 +02:00
|
|
|
], [])
|
|
|
|
|
|
|
|
dnl push
|
|
|
|
restore_cppflags=$CPPFLAGS
|
|
|
|
restore_ldflags=$LDFLAGS
|
2022-07-25 03:31:54 +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++],
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_LIBS], ["-lGraphicsMagick++"])
|
2019-05-29 03:12:28 +02:00
|
|
|
have_imagemagickpp="yes"
|
|
|
|
], [
|
|
|
|
have_imagemagickpp="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([wand/wand_api.h], [MAGICK_WAND_API_H])
|
|
|
|
PKG_CHECK_MODULES(GraphicsMagickWand, [GraphicsMagickWand],
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_LIBS], ["-lGraphicsMagickWand"])
|
2019-05-29 03:12:28 +02:00
|
|
|
have_imagemagickwand="yes"
|
|
|
|
], [
|
|
|
|
have_imagemagickwand="no"
|
|
|
|
])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER([magick/api.h], [MAGICK_API_H])
|
|
|
|
PKG_CHECK_MODULES(GraphicsMagick, [GraphicsMagick],
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([IMAGEMAGICK_LIBS], ["-lGraphicsMagick"])
|
2019-05-29 03:12:28 +02:00
|
|
|
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])
|
2022-06-23 03:59:33 +02:00
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_MAGICK, [0], [Magick support is not available])
|
2020-09-06 00:36:55 +02:00
|
|
|
])
|
|
|
|
|
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-06-23 03:59:33 +02:00
|
|
|
AM_COND_IF(LLVM,
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_LLVM, [1], [libllvm is available and enabled])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_LLVM, [0], [libllvm is not available])
|
|
|
|
])
|
|
|
|
|
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])
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([DRM_LIBS], ["-ldrm"])
|
2022-06-23 03:59:33 +02:00
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_DRM, [0], [DRM support is not available])
|
2022-04-10 20:16:47 +02:00
|
|
|
])
|
|
|
|
|
2022-10-30 19:51:21 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl AMD ROCm
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(ROCM_CPPFLAGS, [])
|
|
|
|
AC_SUBST(ROCM_LDFLAGS, [])
|
|
|
|
AC_SUBST(ROCM_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(rocm-includes,
|
|
|
|
RB_HELP_STRING([--with-rocm-includes=[[[DIR]]]], [Path to ROCm include directory]),
|
|
|
|
[
|
|
|
|
rocm_incdir="$withval"
|
|
|
|
ROCM_CPPFLAGS="-isystem $withval -isystem ${withval}/hsa"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(rocm-libs,
|
|
|
|
RB_HELP_STRING([--with-rocm-libs=[[[DIR]]]], [Path to ROCm library directory]),
|
|
|
|
[
|
|
|
|
rocm_libdir="$withval"
|
|
|
|
ROCM_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
dnl push
|
|
|
|
restore_cppflags=$CPPFLAGS
|
|
|
|
restore_ldflags=$LDFLAGS
|
|
|
|
RB_VAR_PREPEND([CPPFLAGS], [$ROCM_CPPFLAGS])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], [$ROCM_LDFLAGS])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(rocm_version.h, [ROCM_VERSION_H])
|
|
|
|
PKG_CHECK_MODULES(rocm, [rocm-core],
|
|
|
|
[
|
|
|
|
have_rocm="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(rocm-core, getROCmVersion,
|
|
|
|
[
|
|
|
|
have_rocm="yes"
|
|
|
|
], [
|
|
|
|
have_rocm="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl pop
|
|
|
|
CPPFLAGS=$restore_cppflags
|
|
|
|
LDFLAGS=$restore_ldflags
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to disable use of any found ROCm)
|
|
|
|
AC_ARG_ENABLE(rocm, RB_HELP_STRING([--disable-rocm], [Disable ROCm support]),
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([$enableval])
|
|
|
|
enable_rocm=$enableval
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
enable_rocm="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([ROCM], [test "x$have_rocm" = "xyes" && test "x$enable_rocm" = "xyes" ])
|
|
|
|
|
|
|
|
AM_COND_IF([ROCM],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_ROCM, [1], [ROCm support is available and enabled])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_ROCM, [0], [ROCm support is not available])
|
|
|
|
])
|
|
|
|
|
2022-11-01 03:06:21 +01:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl GPU Perf API (GPA)
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(GPA_CPPFLAGS, [])
|
|
|
|
AC_SUBST(GPA_LDFLAGS, [])
|
|
|
|
AC_SUBST(GPA_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(gpa-includes,
|
|
|
|
RB_HELP_STRING([--with-gpa-includes=[[[DIR]]]], [Path to GPA include directory]),
|
|
|
|
[
|
|
|
|
gpa_incdir="$withval"
|
|
|
|
GPA_CPPFLAGS="-isystem $withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(gpa-libs,
|
|
|
|
RB_HELP_STRING([--with-gpa-libs=[[[DIR]]]], [Path to GPA library directory]),
|
|
|
|
[
|
|
|
|
gpa_libdir="$withval"
|
|
|
|
GPA_LDFLAGS="-L$withval"
|
|
|
|
], [])
|
|
|
|
|
|
|
|
dnl push
|
|
|
|
restore_cppflags=$CPPFLAGS
|
|
|
|
restore_ldflags=$LDFLAGS
|
|
|
|
RB_VAR_PREPEND([CPPFLAGS], [$GPA_CPPFLAGS])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], [$GPA_LDFLAGS])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(gpu_performance_api/gpu_perf_api.h, [GPU_PERF_API_H])
|
|
|
|
PKG_CHECK_MODULES(gpa, [GPUPerfAPIVK],
|
|
|
|
[
|
|
|
|
have_gpa="yes"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB(GPUPerfAPIVK, GpaGetVersion,
|
|
|
|
[
|
|
|
|
have_gpa="yes"
|
|
|
|
], [
|
|
|
|
have_gpa="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl pop
|
|
|
|
CPPFLAGS=$restore_cppflags
|
|
|
|
LDFLAGS=$restore_ldflags
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to disable use of any found GPA)
|
|
|
|
AC_ARG_ENABLE(gpa, RB_HELP_STRING([--disable-gpa], [Disable GPA support]),
|
|
|
|
[
|
|
|
|
AC_MSG_RESULT([$enableval])
|
|
|
|
enable_gpa=$enableval
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT([no])
|
|
|
|
enable_gpa="yes"
|
|
|
|
])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([GPA], [test "x$have_gpa" = "xyes" && test "x$enable_gpa" = "xyes" ])
|
|
|
|
|
|
|
|
AM_COND_IF([GPA],
|
|
|
|
[
|
|
|
|
IRCD_DEFINE(USE_GPA, [1], [GPA support is available and enabled])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_GPA, [0], [GPA support is not available])
|
|
|
|
])
|
|
|
|
|
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"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
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_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])
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([OPENCL_LIBS], ["-lOpenCL"])
|
2022-06-23 03:59:33 +02:00
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_OPENCL, [0], [OpenCL support is not available])
|
2020-10-08 00:41:32 +02:00
|
|
|
])
|
|
|
|
|
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])
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ARMNN_LIBS], ["-larmnn"])
|
2022-06-23 03:59:33 +02:00
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_ARMNN, [0], [Arm NN support is not available])
|
2021-03-13 23:39:45 +01:00
|
|
|
])
|
|
|
|
|
2022-09-04 20:08:05 +02:00
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
dnl liburing
|
|
|
|
dnl
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(URING_CPPFLAGS, [])
|
|
|
|
AC_SUBST(URING_LDFLAGS, [])
|
|
|
|
AC_SUBST(URING_LIBS, [])
|
|
|
|
|
|
|
|
AC_ARG_WITH(uring-includes,
|
|
|
|
RB_HELP_STRING([--with-uring-includes=[[[DIR]]]], [Path to uring include directory]),
|
|
|
|
[
|
|
|
|
RB_VAR_APPEND([URING_CPPFLAGS], ["-isystem $withval"])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_ARG_WITH(uring-libs,
|
|
|
|
RB_HELP_STRING([--with-uring-libs=[[[DIR]]]], [Path to uring libraries directory]),
|
|
|
|
[
|
|
|
|
RB_VAR_APPEND([URING_LDFLAGS], ["-L$withval"])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl push
|
|
|
|
restore_cppflags=$CPPFLAGS
|
|
|
|
restore_ldflags=$LDFLAGS
|
|
|
|
RB_VAR_PREPEND([CPPFLAGS], [$URING_CPPFLAGS])
|
|
|
|
RB_VAR_PREPEND([LDFLAGS], [$URING_LDFLAGS])
|
|
|
|
|
|
|
|
RB_CHK_SYSHEADER(liburing.h, [LIBURING_H])
|
|
|
|
|
|
|
|
have_uring="no"
|
|
|
|
PKG_CHECK_MODULES(uring, [uring],
|
|
|
|
[
|
|
|
|
have_uring="$iou"
|
|
|
|
], [
|
|
|
|
AC_CHECK_LIB([uring], [io_uring_queue_init],
|
|
|
|
[
|
|
|
|
have_uring="$iou"
|
|
|
|
], [
|
|
|
|
have_uring="no"
|
|
|
|
])
|
|
|
|
])
|
|
|
|
|
|
|
|
dnl pop
|
|
|
|
CPPFLAGS=$restore_cppflags
|
|
|
|
LDFLAGS=$restore_ldflags
|
|
|
|
|
|
|
|
AM_CONDITIONAL([URING], [test "x$have_uring" = "xyes"])
|
|
|
|
|
|
|
|
AM_COND_IF([URING],
|
|
|
|
[
|
|
|
|
RB_VAR_APPEND([LIBS], ["-luring"])
|
|
|
|
IRCD_DEFINE(USE_URING, [1], [liburing's availability for use.])
|
|
|
|
], [
|
|
|
|
IRCD_DEFINE(USE_URING, [0], [liburing's availability for use.])
|
|
|
|
])
|
|
|
|
|
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"
|
2022-09-04 01:21:48 +02:00
|
|
|
BOOST_BUILT_LIBS="coroutine,context,thread,chrono,system"
|
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,
|
2022-09-04 01:21:48 +02:00
|
|
|
RB_HELP_STRING([--with-included-boost[[[=built]]]], [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
|
|
|
|
2022-09-04 01:21:48 +02:00
|
|
|
boost_version="$withval"
|
|
|
|
if test x"$boost_version" == x"yes"; then
|
|
|
|
boost_version="${BOOST_VERSION_MIN}.${BOOST_VERSION_MIN_PATCH}"
|
2016-08-14 00:08:24 +02:00
|
|
|
fi
|
|
|
|
|
2022-09-04 01:21:48 +02:00
|
|
|
boost_linkage="shared"
|
|
|
|
boost_version="boost-${boost_version}"
|
2022-06-18 04:27:28 +02:00
|
|
|
boost_cxxflags="-std=gnu++20"
|
2016-07-20 20:55:46 +02:00
|
|
|
|
2022-09-04 01:21:48 +02:00
|
|
|
if [[ $boost_version != "boost-built" ]]; then
|
|
|
|
bash tools/boostrap.sh $BTOOLSET $BOOST_BUILT_LIBS $boost_variant $boost_linkage multi $boost_version $boost_cxxflags
|
|
|
|
AS_IF([ test $? != 0 ],
|
|
|
|
[
|
|
|
|
AC_MSG_ERROR([Failed to build included boost.])
|
|
|
|
])
|
|
|
|
|
|
|
|
AC_DEFINE(RB_INCLUDED_BOOST, 1, [Defined if configured with included boost])
|
|
|
|
AC_MSG_NOTICE([Bootstrapping boost: done])
|
|
|
|
fi
|
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
|
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],
|
|
|
|
[
|
2022-07-05 21:09:52 +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_system-mgw53-1_61.dll"])
|
2016-07-25 05:31:08 +02:00
|
|
|
], [
|
2022-07-05 21:09:52 +02:00
|
|
|
AC_SUBST(BOOST_LIBS, ["-lboost_coroutine -lboost_context -lboost_thread -lboost_chrono -lboost_system"])
|
2016-07-25 05:31:08 +02:00
|
|
|
])
|
|
|
|
else
|
|
|
|
AM_COND_IF([MINGW],
|
|
|
|
[
|
2022-07-05 21:09:52 +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_system-mgw53-1_61.dll.a"])
|
2016-07-25 05:31:08 +02:00
|
|
|
], [
|
2022-07-05 21:09:52 +02:00
|
|
|
AC_SUBST(BOOST_LIBS, ["$boost_libdir/libboost_coroutine.a $boost_libdir/libboost_context.a $boost_libdir/libboost_thread.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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ASIO_UNIT_CPPFLAGS], ["$BOOST_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ASIO_UNIT_CPPFLAGS], ["$SSL_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ASIO_UNIT_CPPFLAGS], ["$CRYPTO_CPPFLAGS"])
|
2022-09-04 20:08:05 +02:00
|
|
|
RB_VAR_APPEND([ASIO_UNIT_CPPFLAGS], ["$URING_CPPFLAGS"])
|
2020-10-11 20:44:34 +02:00
|
|
|
|
|
|
|
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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CPPFLAGS], ["$ICU_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CPPFLAGS], ["$BOOST_CPPFLAGS"])
|
2020-10-11 20:44:34 +02:00
|
|
|
|
|
|
|
AC_SUBST(SPIRIT_UNIT_CXXFLAGS)
|
|
|
|
AM_COND_IF([GCC],
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CXXFLAGS], ["-fno-var-tracking"])
|
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CXXFLAGS], ["-fno-var-tracking-assignments"])
|
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CXXFLAGS], ["-femit-struct-debug-baseonly"])
|
2020-10-11 20:44:34 +02:00
|
|
|
|
|
|
|
AM_COND_IF([LOWMEM_COMPILE],
|
|
|
|
[
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CXXFLAGS], ["--param ggc-min-expand=1"])
|
|
|
|
RB_VAR_APPEND([SPIRIT_UNIT_CXXFLAGS], ["-fno-ipa-pta"])
|
2020-10-11 20:44:34 +02:00
|
|
|
])
|
|
|
|
])
|
|
|
|
|
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
|
|
|
|
2022-09-10 04:02:42 +02:00
|
|
|
ROCKSDB_VERSION_DEFAULT="v7.4.5"
|
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/"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ROCKSDB_LDFLAGS], ["-Wl,-rpath=$PWD/deps/rocksdb"])
|
2020-05-07 05:23:32 +02:00
|
|
|
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
|
|
|
|
2022-07-23 04:15:25 +02:00
|
|
|
if [[ $rocksdb_version != "built" ]]; then
|
|
|
|
bash tools/buildrocks.sh $rocksdb_linkage $rocksdb_version
|
|
|
|
fi
|
|
|
|
|
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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([ROCKSDB_UNIT_CPPFLAGS], ["$ROCKSDB_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ROCKSDB_UNIT_CPPFLAGS], ["$ZSTD_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ROCKSDB_UNIT_CPPFLAGS], ["$SNAPPY_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ROCKSDB_UNIT_CPPFLAGS], ["$LZ4_CPPFLAGS"])
|
|
|
|
RB_VAR_APPEND([ROCKSDB_UNIT_CPPFLAGS], ["$Z_CPPFLAGS"])
|
2020-10-11 20:44:34 +02:00
|
|
|
|
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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([JS_CPPFLAGS], ["-isystem $PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/include"])
|
2018-01-28 05:46:41 +01:00
|
|
|
#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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([JS_LDFLAGS], ["-L$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/sdk/lib"])
|
|
|
|
RB_VAR_APPEND([JS_LDFLAGS], ["-L$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/intl/icu/target/lib"])
|
|
|
|
RB_VAR_APPEND([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)
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([JS_LIBS], ["-lmozjs-68"])
|
|
|
|
RB_VAR_APPEND([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"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([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"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([JS_LDFLAGS], ["-Wl,-rpath=$PWD/deps/gecko-dev/js/src/build_OPT.OBJ/dist/sdk/lib"])
|
|
|
|
RB_VAR_APPEND([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"
|
2022-07-25 03:31:54 +02:00
|
|
|
RB_VAR_APPEND([JS_LIBS], ["-ljs_static"])
|
2016-10-11 06:28:16 +02:00
|
|
|
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
|
2020-07-12 20:48:48 +02:00
|
|
|
echo "Developer platform (build) ........ $build_cpu $build_vendor $build_os"
|
2022-07-27 21:40:22 +02:00
|
|
|
echo "Target platform (host) ............ $host_cpu $host_vendor $host_os"
|
|
|
|
echo "Target features ................... $machine_tuning $machine_features"
|
|
|
|
echo
|
|
|
|
echo "Precompile headers ................ $build_pch"
|
|
|
|
echo "Developer warnings ................ $warnings"
|
2022-07-27 19:47:24 +02:00
|
|
|
echo "Developer debugging ............... $debug"
|
|
|
|
echo "Developer assertions .............. $assert ($assert_type)"
|
|
|
|
echo "Optimized compile ................. $optimize (-O$optimize_level)"
|
2019-09-26 05:30:26 +02:00
|
|
|
echo "Optimized linking ................. $lto"
|
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"
|
2022-10-30 19:51:21 +01:00
|
|
|
echo "AMD ROCm support .................. $have_rocm"
|
2022-11-01 03:06:21 +01:00
|
|
|
echo "AMD GPA support ................... $have_gpa"
|
2021-01-16 02:15:49 +01:00
|
|
|
echo "OpenCL support .................... $have_opencl"
|
2022-09-04 20:08:05 +02:00
|
|
|
echo "Liburing support .................. $have_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'"
|