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

Contents of /lbbs/configure.ac

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.62 - (show annotations)
Tue Nov 18 03:19:20 2025 UTC (3 months, 4 weeks ago) by sysadm
Branch: MAIN
Changes since 1.61: +31 -36 lines
Content type: application/pkix-attr-cert
Refact configure.ac

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([iconv],
23 [AS_HELP_STRING([--with-iconv], [Use iconv library package config])],
24 [],
25 [with_iconv="no"])
26 AC_ARG_WITH([mariadb],
27 [AS_HELP_STRING([--with-mariadb], [Use MariaDB library instead of MySQL client library])],
28 [],
29 [with_mariadb="no"])
30 AC_ARG_ENABLE([systemd],
31 [AS_HELP_STRING([--enable-systemd], [Enable systemd daemon])],
32 [],
33 [enable_systemd="no"])
34 AC_ARG_WITH([epoll],
35 [AS_HELP_STRING([--with-epoll], [Use epoll instead of poll])],
36 [],
37 [with_epoll="yes"])
38
39 AC_SUBST([PKG_CONFIG_PATH])
40 PKG_PROG_PKG_CONFIG
41 PKG_CHECK_MODULES([LIBSSH], [libssh], [], [AC_MSG_ERROR([libssh is required.])])
42 PKG_CHECK_MODULES([LIBPCRE2], [libpcre2-8], [], [AC_MSG_ERROR([libpcre2-8 is required.])])
43
44 AS_IF([test "x$with_iconv" = xyes],
45 [PKG_CHECK_MODULES([ICONV], [iconv], [], [AC_MSG_ERROR([iconv is required.])])])
46
47 AS_IF([test "x$with_mariadb" = xyes],
48 [PKG_CHECK_MODULES([MYSQLCLIENT], [libmariadb], [], [AC_MSG_ERROR([libmariadb is required.])])],
49 [PKG_CHECK_MODULES([MYSQLCLIENT], [mysqlclient], [], [AC_MSG_ERROR([mysqlclient is required.])])])
50
51 AS_IF([test "x$enable_systemd" = xyes],
52 [PKG_CHECK_MODULES([SYSTEMD], [libsystemd], [], [AC_MSG_ERROR([libsystemd is required.])])])
53
54 CPPFLAGS="$CPPFLAGS $LIBSSH_CFLAGS $MYSQLCLIENT_CFLAGS $SYSTEMD_CFLAGS $LIBPCRE2_CFLAGS $ICONV_CFLAGS"
55
56 # Checks for libraries.
57 AC_HEADER_STAT
58 AC_PROG_EGREP
59
60 AC_HEADER_RESOLV
61 AC_HEADER_SYS_WAIT
62 AC_CHECK_HEADERS([arpa/inet.h fcntl.h iconv.h libssh/libssh.h mysql.h netdb.h netinet/in.h pcre2.h \
63 pty.h signal.h stdint.h stdlib.h string.h sys/ioctl.h sys/ipc.h sys/mman.h sys/param.h sys/socket.h \
64 sys/types.h sys/sem.h sys/shm.h sys/stat.h sys/wait.h time.h unistd.h utmp.h wchar.h],
65 [],
66 [AC_MSG_ERROR([Missing required header file])],
67 [#define PCRE2_CODE_UNIT_WIDTH 8])
68
69 AS_IF([test "x$enable_systemd" = xyes],
70 [AC_CHECK_HEADERS([systemd/sd-daemon.h], [], [AC_MSG_ERROR([systemd/sd-daemon.h not found.])])])
71
72 AS_IF([test "x$with_epoll" = xyes],
73 [AC_CHECK_HEADERS([sys/epoll.h], [], [AC_MSG_ERROR([sys/epoll.h not found.])])],
74 [AC_CHECK_HEADERS([poll.h], [], [AC_MSG_ERROR([poll.h not found.])])])
75
76 # Checks for typedefs, structures, and compiler characteristics.
77 AC_C_CONST
78 AC_TYPE_SIZE_T
79
80 AC_STRUCT_TM
81
82 # Checks for library functions.
83 AC_FUNC_FORK
84 AC_FUNC_MALLOC
85 AC_FUNC_SELECT_ARGTYPES
86 AC_FUNC_MMAP
87 AC_FUNC_MKTIME
88
89 AC_DEFINE_UNQUOTED([RETSIGTYPE],
90 [$ac_cv_type_signal],
91 [Define as the return type of signal handlers (`int' or `void').])
92
93 AC_FUNC_STRFTIME
94 AC_FUNC_VPRINTF
95 AC_CHECK_FUNCS([dup2 gethostbyname inet_ntoa memset mkdir rmdir regcomp poll socket strstr])
96
97 AC_CONFIG_FILES([Makefile
98 src/Makefile
99 utils/Makefile
100 utils/game/Makefile
101 conf/lbbs.service
102 conf/lbbs.logrotate])
103
104 AC_ARG_ENABLE([debug],
105 [AS_HELP_STRING([--enable-debug], [Enable debug log])],
106 [AS_IF([test "x$enable_debug" = xyes],
107 [AC_DEFINE([_DEBUG], [1], [Define if debug log is enabled])])])
108
109 AC_OUTPUT

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