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