| 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.5.5]) |
| 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([foreign]) |
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_SUBST([PKG_CONFIG_PATH]) |
| 23 |
|
PKG_PROG_PKG_CONFIG |
| 24 |
|
PKG_CHECK_MODULES([LIBSSH], [libssh]) |
| 25 |
|
PKG_CHECK_MODULES([LIBPCRE2], [libpcre2-8]) |
| 26 |
|
|
| 27 |
|
AC_ARG_WITH([mariadb], |
| 28 |
|
[AS_HELP_STRING([--with-mariadb], [Use MariaDB library instead of MySQL client library])], |
| 29 |
|
[], |
| 30 |
|
[with_mariadb="no"]) |
| 31 |
|
|
| 32 |
|
AS_IF([test "x$with_mariadb" = xyes], |
| 33 |
|
[PKG_CHECK_MODULES([MYSQLCLIENT], [libmariadb])]) |
| 34 |
|
AS_IF([test "x$with_mariadb" = xno], |
| 35 |
|
[PKG_CHECK_MODULES([MYSQLCLIENT], [mysqlclient])]) |
| 36 |
|
|
| 37 |
|
AC_ARG_ENABLE([systemd], |
| 38 |
|
[AS_HELP_STRING([--enable-systemd], [Enable systemd daemon])], |
| 39 |
|
[], |
| 40 |
|
[enable_systemd="no"]) |
| 41 |
|
|
| 42 |
|
AS_IF([test "x$enable_systemd" = xyes], |
| 43 |
|
[PKG_CHECK_MODULES([SYSTEMD], [libsystemd])]) |
| 44 |
|
|
| 45 |
# Checks for libraries. |
# Checks for libraries. |
| 46 |
AC_CHECK_LIB([mysqlclient], [mysql_connect]) |
AS_IF([test "x$with_mariadb" = xyes], |
| 47 |
AC_CHECK_LIB([z], [unzip]) |
[AC_CHECK_LIB([mariadb], [mysql_real_connect])]) |
| 48 |
|
AS_IF([test "x$with_mariadb" = xno], |
| 49 |
|
[AC_CHECK_LIB([mysqlclient], [mysql_real_connect])]) |
| 50 |
|
|
| 51 |
|
AC_CHECK_LIB([ssh], [ssh_init]) |
| 52 |
|
|
| 53 |
|
AC_HEADER_STAT |
| 54 |
|
AC_PROG_EGREP |
| 55 |
|
|
| 56 |
|
AC_HEADER_RESOLV |
| 57 |
AC_HEADER_SYS_WAIT |
AC_HEADER_SYS_WAIT |
| 58 |
AC_CHECK_HEADERS([arpa/inet.h dflcn.h fcntl.h libssh/libssh.h libssh/server.h memory.h mysql/mysql.h netdb.h netinet/in.h signal.h \ |
AC_CHECK_HEADERS([arpa/inet.h dflcn.h fcntl.h iconv.h libssh/libssh.h libssh/server.h memory.h mysql/mysql.h net/if.h netdb.h netinet/in.h \ |
| 59 |
stdint.h stdlib.h string.h strings.h sys/epoll.h sys/ioctl.h sys/ipc.h sys/mman.h sys/param.h sys/socket.h \ |
pty.h signal.h stdint.h stdlib.h string.h sys/epoll.h sys/ioctl.h sys/ipc.h sys/mman.h sys/param.h sys/socket.h \ |
| 60 |
sys/time.h sys/types.h sys/sem.h sys/shm.h sys/stat.h sys/syscall.h sys/wait.h systemd/sd-daemon.h unistd.h]) |
sys/time.h sys/types.h sys/sem.h sys/shm.h sys/stat.h sys/syscall.h sys/wait.h \ |
| 61 |
|
unistd.h utmp.h wchar.h]) |
| 62 |
|
|
| 63 |
|
AS_IF([test "x$enable_systemd" = xyes], |
| 64 |
|
[AC_CHECK_HEADERS([systemd/sd-daemon.h])]) |
| 65 |
|
|
| 66 |
# Checks for typedefs, structures, and compiler characteristics. |
# Checks for typedefs, structures, and compiler characteristics. |
| 67 |
AC_C_CONST |
AC_C_CONST |
| 74 |
AC_FUNC_FORK |
AC_FUNC_FORK |
| 75 |
AC_FUNC_MALLOC |
AC_FUNC_MALLOC |
| 76 |
AC_FUNC_SELECT_ARGTYPES |
AC_FUNC_SELECT_ARGTYPES |
| 77 |
|
AC_FUNC_MMAP |
| 78 |
|
AC_FUNC_MKTIME |
| 79 |
|
|
| 80 |
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers |
AC_DEFINE_UNQUOTED([RETSIGTYPE],[$ac_cv_type_signal],[Define as the return type of signal handlers |
| 81 |
(`int' or `void').]) |
(`int' or `void').]) |
| 82 |
|
|
| 83 |
AC_FUNC_STRFTIME |
AC_FUNC_STRFTIME |
| 84 |
AC_FUNC_VPRINTF |
AC_FUNC_VPRINTF |
| 85 |
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 select socket strstr]) |
| 86 |
|
|
| 87 |
AC_CONFIG_FILES([Makefile |
AC_CONFIG_FILES([Makefile |
| 88 |
src/Makefile |
src/Makefile |
| 89 |
utils/Makefile |
utils/Makefile |
| 90 |
utils/game/Makefile]) |
utils/game/Makefile |
| 91 |
|
conf/lbbs.service |
| 92 |
|
conf/lbbs.logrotate]) |
| 93 |
|
|
| 94 |
|
AC_ARG_ENABLE([debug], |
| 95 |
|
[AS_HELP_STRING([--enable-debug], [Enable debug log])], |
| 96 |
|
[AS_IF([test "x$enable_debug" = xyes], |
| 97 |
|
[AC_DEFINE([_DEBUG], [1], [Define if debug log is enabled])])]) |
| 98 |
|
|
| 99 |
AC_OUTPUT |
AC_OUTPUT |