1 # Inspired by work Copyright (C) 2006 Luca Filipozzi
2 # vim: set fdm=marker ts=2 sw=2 et:
7 AC_INIT([plexus], [20220622_0-613], [https://gitlab.com/rizon/plexus4/])
8 AM_INIT_AUTOMAKE(1.11.1 subdir-objects)
9 AC_CONFIG_MACRO_DIR([m4])
10 AC_CONFIG_HEADER(config.h)
11 AC_CONFIG_SRCDIR(src/ircd.c)
13 # Checks for programs.
16 AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
17 [AC_MSG_ERROR([no suitable C99 compiler found. Aborting.])])
22 # Initializing libtool.
23 LT_CONFIG_LTDL_DIR([libltdl])
24 LT_INIT([dlopen disable-static])
25 LTDL_INIT([recursive convenience])
26 LIBTOOL="$LIBTOOL --silent"
28 # Checks for libraries.
31 AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing])
36 # Checks for typedefs, structures, and compiler characteristics.
39 # Checks for library functions.
40 AC_CHECK_FUNCS_ONCE(strtok_r \
45 # Checks for header files.
46 AC_CHECK_HEADERS_ONCE(crypt.h \
54 AC_SEARCH_LIBS(crypt, crypt)
56 AC_ARG_ENABLE(libgeoip,
57 [AS_HELP_STRING([--enable-libgeoip],[Enable GeoIP support])],
58 [AC_CHECK_HEADER(GeoIP.h,
59 [AC_SEARCH_LIBS(GeoIP_id_by_ipnum_v6_gl, GeoIP,
60 [AC_DEFINE(HAVE_LIBGEOIP, 1, [Define to 1 if libGeoIP (-lGeoIP) is available.])])])], [], [])
62 AC_ARG_ENABLE(libjansson,
63 [AS_HELP_STRING([--enable-libjansson],[Enable libjansson])],
64 [AC_CHECK_HEADER(jansson.h,
65 [AC_SEARCH_LIBS(json_object, jansson,
66 [AC_DEFINE(HAVE_LIBJANSSON, 1, [Define to 1 if libjansson (-ljansson) is available.])],
67 [AC_MSG_ERROR([No libjansson found])]
69 [AC_MSG_ERROR([No jansson.h found])]
73 AC_ARG_ENABLE(libmicrohttpd,
74 [AS_HELP_STRING([--enable-libmicrohttpd],[Enable libmicrohttpd])],
75 [AC_CHECK_HEADER(microhttpd.h,
76 [AC_SEARCH_LIBS(MHD_start_daemon, microhttpd,
77 [AC_DEFINE(HAVE_LIBMICROHTTPD, 1, [Define to 1 if libmicrohttpd (-lmicrohttpd) is available.])],
78 [AC_MSG_ERROR([No libmicrohttpd found])]
80 [AC_MSG_ERROR([No microhttpd.h found])]
86 # Check for pkg-config
88 if test m4_ifdef([PKG_CHECK_MODULES], [yes], [no]) == yes; then
89 AC_CHECK_HEADER(check.h,
90 [PKG_CHECK_MODULES([CHECK], [check], [
92 AC_REQUIRE_AUX_FILE([tap-driver.sh])
96 AM_CONDITIONAL([HAVE_CHECK], [test "$USE_CHECK" -eq 1])
98 AC_CHECK_LIB(dl, dlopen, AC_SUBST(LDL, "-ldl"))
100 AC_ARG_ENABLE(assert, AS_HELP_STRING([--enable-assert],
101 [Enable assert() statements]),
102 [assert=$enableval], [assert=no])
104 AS_IF([test "$assert" = "no"],
105 [AC_DEFINE(NDEBUG, 1, [Define to disable assert() statements.])])
107 AC_DEFINE([NICKNAMEHISTORYLENGTH], 32768, [Size of the WHOWAS array.])
108 AC_DEFINE([MP_CHUNK_SIZE_CHANNEL], 1024*1024, [Size of the channel mempool chunk.])
109 AC_DEFINE([MP_CHUNK_SIZE_MEMBER], 2048*1024, [Size of the channel-member mempool chunk.])
110 AC_DEFINE([MP_CHUNK_SIZE_BAN], 1024*1024, [Size of the ban mempool chunk.])
111 AC_DEFINE([MP_CHUNK_SIZE_CLIENT], 1024*1024, [Size of the client mempool chunk.])
112 AC_DEFINE([MP_CHUNK_SIZE_LCLIENT], 512*1024, [Size of the local client mempool chunk.])
113 AC_DEFINE([MP_CHUNK_SIZE_DNODE], 32*1024, [Size of the dlink_node mempool chunk.])
114 AC_DEFINE([MP_CHUNK_SIZE_DBUF], 512*1024, [Size of the dbuf mempool chunk.])
115 AC_DEFINE([MP_CHUNK_SIZE_AUTH], 128*1024, [Size of the auth mempool chunk.])
116 AC_DEFINE([MP_CHUNK_SIZE_DNS], 64*1024, [Size of the dns mempool chunk.])
117 AC_DEFINE([MP_CHUNK_SIZE_WATCH], 8*1024, [Size of the watch mempool chunk.])
118 AC_DEFINE([MP_CHUNK_SIZE_USERHOST], 128*1024, [Size of the userhost mempool chunk.])
119 AC_DEFINE([MP_CHUNK_SIZE_IP_ENTRY], 128*1024, [Size of the ip_entry mempool chunk.])
120 AC_DEFINE([MP_CHUNK_SIZE_INVITE], 8*1024, [Size of the invite mempool chunk.])
122 # Argument processing.
123 AX_ARG_ENABLE_IOLOOP_MECHANISM
124 AX_ARG_ENABLE_HALFOPS
126 AX_ARG_ENABLE_DEBUGGING
127 AX_ARG_ENABLE_WARNINGS
129 AC_DEFINE_DIR([PREFIX],[prefix],[Set to prefix.])
130 AC_DEFINE_DIR([SYSCONFDIR],[sysconfdir],[Set to sysconfdir.])
131 AC_DEFINE_DIR([LIBDIR],[libdir],[Set to libdir.])
132 AC_DEFINE_DIR([DATADIR],[datadir],[Set to datadir.])
133 AC_DEFINE_DIR([LOCALSTATEDIR],[localstatedir],[Set to localstatedir.])
142 modules/core/Makefile \