/[LeafOK_CVS]/lbbs/configure.ac
ViewVC logotype

Contents of /lbbs/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.64 - (show annotations)
Fri Nov 21 02:49:26 2025 UTC (3 months, 3 weeks ago) by sysadm
Branch: MAIN
Changes since 1.63: +2 -1 lines
Content type: application/pkix-attr-cert
Add alternative implementation with MariaDB client

1 # -*- Autoconf -*-
2 # Process this file with autoconf to produce a configure script.
3
4 AC_PREREQ([2.69])
5 AC_INIT([lbbs],[1.5.6])
6 AC_CONFIG_SRCDIR([src/])
7 AC_CONFIG_HEADERS([config.h])
8 AC_CONFIG_MACRO_DIRS([m4])
9 AM_INIT_AUTOMAKE([foreign])
10 AM_SILENT_RULES(yes)
11
12 AC_USE_SYSTEM_EXTENSIONS
13 # Checks for programs.
14 LT_INIT
15 AC_PROG_CXX
16 AC_PROG_CC
17 AC_PROG_CPP
18 AC_PROG_INSTALL
19 AC_PROG_LN_S
20 AC_PROG_MAKE_SET
21
22 AC_ARG_WITH([sysv],
23 [AS_HELP_STRING([--with-sysv], [Use System V specific APIs])],
24 [AS_IF([test "x$with_sysv" = xyes],
25 [AC_DEFINE([HAVE_SYSTEM_V], [1], [Define if System V is available])])])
26 AC_ARG_ENABLE([debug],
27 [AS_HELP_STRING([--enable-debug], [Enable debug log])],
28 [AS_IF([test "x$enable_debug" = xyes],
29 [AC_DEFINE([_DEBUG], [1], [Define if debug log is enabled])])])
30
31 AC_ARG_WITH([iconv],
32 [AS_HELP_STRING([--with-iconv], [Use iconv library package config])],
33 [],
34 [with_iconv="no"])
35 AC_ARG_WITH([mariadb],
36 [AS_HELP_STRING([--with-mariadb], [Use MariaDB library instead of MySQL client library])],
37 [AS_IF([test "x$with_mariadb" = xyes],
38 [AC_DEFINE([HAVE_MARIADB_CLIENT], [1], [Define if MariaDB client is used])])],
39 [with_mariadb="no"])
40 AC_ARG_ENABLE([systemd],
41 [AS_HELP_STRING([--enable-systemd], [Enable systemd daemon])],
42 [],
43 [enable_systemd="no"])
44 AC_ARG_WITH([epoll],
45 [AS_HELP_STRING([--with-epoll], [Use epoll instead of poll])],
46 [],
47 [with_epoll="yes"])
48
49 AC_SUBST([PKG_CONFIG_PATH])
50 PKG_PROG_PKG_CONFIG
51 PKG_CHECK_MODULES([LIBSSH], [libssh], [], [AC_MSG_ERROR([libssh is required.])])
52 PKG_CHECK_MODULES([LIBPCRE2], [libpcre2-8], [], [AC_MSG_ERROR([libpcre2-8 is required.])])
53
54 AS_IF([test "x$with_iconv" = xyes],
55 [PKG_CHECK_MODULES([ICONV], [iconv], [], [AC_MSG_ERROR([iconv is required.])])])
56
57 AS_IF([test "x$with_mariadb" = xyes],
58 [PKG_CHECK_MODULES([MYSQLCLIENT], [libmariadb], [], [AC_MSG_ERROR([libmariadb is required.])])],
59 [PKG_CHECK_MODULES([MYSQLCLIENT], [mysqlclient], [], [AC_MSG_ERROR([mysqlclient is required.])])])
60
61 AS_IF([test "x$enable_systemd" = xyes],
62 [PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], [AC_MSG_ERROR([libsystemd is required.])])])
63
64 CPPFLAGS="$CPPFLAGS $LIBSSH_CFLAGS $MYSQLCLIENT_CFLAGS $SYSTEMD_CFLAGS $LIBPCRE2_CFLAGS $ICONV_CFLAGS"
65
66 # Checks for libraries.
67 AC_HEADER_STAT
68 AC_PROG_EGREP
69
70 AC_HEADER_RESOLV
71 AC_HEADER_SYS_WAIT
72 AC_CHECK_HEADERS([arpa/inet.h fcntl.h iconv.h libssh/libssh.h mysql.h netdb.h netinet/in.h pcre2.h pty.h \
73 semaphore.h signal.h stdint.h stdlib.h string.h sys/ioctl.h sys/mman.h sys/param.h sys/socket.h \
74 sys/types.h sys/sem.h sys/stat.h sys/wait.h time.h unistd.h utmp.h wchar.h],
75 [],
76 [AC_MSG_ERROR([Missing required header file])],
77 [#define PCRE2_CODE_UNIT_WIDTH 8])
78
79 AS_IF([test "x$enable_systemd" = xyes],
80 [AC_CHECK_HEADERS([systemd/sd-daemon.h], [], [AC_MSG_ERROR([systemd/sd-daemon.h not found.])])])
81
82 AS_IF([test "x$with_epoll" = xyes],
83 [AC_CHECK_HEADERS([sys/epoll.h], [], [AC_MSG_ERROR([sys/epoll.h not found.])])],
84 [AC_CHECK_HEADERS([poll.h], [], [AC_MSG_ERROR([poll.h not found.])])])
85
86 # Checks for typedefs, structures, and compiler characteristics.
87 AC_C_CONST
88 AC_TYPE_SIZE_T
89
90 AC_STRUCT_TM
91
92 # Checks for library functions.
93 AC_FUNC_FORK
94 AC_FUNC_MALLOC
95 AC_FUNC_SELECT_ARGTYPES
96 AC_FUNC_MMAP
97 AC_FUNC_MKTIME
98
99 AC_DEFINE_UNQUOTED([RETSIGTYPE],
100 [$ac_cv_type_signal],
101 [Define as the return type of signal handlers (`int' or `void').])
102
103 AC_FUNC_STRFTIME
104 AC_FUNC_VPRINTF
105 AC_CHECK_FUNCS([dup2 gethostbyname inet_ntoa memset mkdir rmdir regcomp poll socket strstr])
106
107 AC_CONFIG_FILES([Makefile
108 src/Makefile
109 utils/Makefile
110 utils/game/Makefile
111 conf/lbbs.service
112 conf/lbbs.logrotate])
113
114 AC_OUTPUT

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1