summaryrefslogtreecommitdiffstats
path: root/configure.ac
blob: 68ce7e878a96a5a5f748e0f91a14af056c394c0c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ(2.61)
AC_INIT(mad, 0.1, matthias@gamezock.de)
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_SRCDIR([src/mad.cpp])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE(mad, 0.1)
AM_MAINTAINER_MODE

# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_CHECK_PROG(have_df, [df], yes, no)

ORIG_LIBS=$LIBS

LT_CONFIG_LTDL_DIR([libltdl])
LT_INIT([dlopen])
LTDL_INIT([recursive])
AC_SUBST(LIBLTDL)

AM_CONDITIONAL(INCLUDED_LTDL, test "x$with_included_ltdl" = xyes)

# Checks for libraries.
PKG_CHECK_MODULES(libxml2, libxml-2.0, , AC_MSG_ERROR(Test for libxml 2.0 failed.))
PKG_CHECK_MODULES(GnuTLS, gnutls, , AC_MSG_ERROR(Test for GnuTLS failed.))
PKG_CHECK_MODULES(sigc, sigc++-2.0, , AC_MSG_ERROR(Test for SigC++ 2.0 failed.))

AX_LIB_MYSQL

CPPFLAGS='-I${top_srcdir}'"/src $libxml2_CFLAGS $GnuTLS_CFLAGS $sigc_CFLAGS $MYSQL_CFLAGS $INCLTDL $CPPFLAGS"

AC_CHECK_LIB(gssapi_krb5, gss_init_sec_context, AC_SUBST(GSSAPI_LIBS, -lgssapi_krb5), AC_CHECK_LIB(gssapi, gss_init_sec_context, GSSAPI_LIBS=-lgssapi, AC_MSG_ERROR(Test for GSSAPI library failed.)))
AC_CHECK_LIB(readline, readline, AC_SUBST(READLINE_LIBS, -lreadline), AC_MSG_ERROR(Test for GNU readline library failed.))

LIBS=$ORIG_LIBS 

# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([argz.h arpa/inet.h fcntl.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h unistd.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINT8_T

# Checks for library functions.
AC_FUNC_MALLOC
AC_HEADER_STDC
AC_FUNC_REALLOC
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([dup2 gethostname memmove memset socket strcasecmp strchr strdup strerror strrchr strtol])

with_systembackend_proc=no

AC_CHECK_FILES([/proc/uptime /proc/meminfo /proc/loadavg], with_systembackend_proc=yes)

AC_ARG_WITH([systembackend_posix], [AS_HELP_STRING([--with-systembackend-posix],
  [enable POSIX system backend @<:@default=yes@:>@])])
AC_ARG_WITH([systembackend_proc], [AS_HELP_STRING([--with-systembackend-proc],
  [enable /proc system backend])])
AC_ARG_WITH([userbackend_mysql], [AS_HELP_STRING([--with-userbackend-mysql],
  [enable MySQL user backend @<:@default=yes@:>@])])

AC_CHECK_FUNCS([posix_spawnp], , [with_systembackend_posix=no])
if test x"$have_df" = xno; then
  with_systembackend_posix=no
fi

if test x"$found_mysql" = xno; then
  with_userbackend_mysql=no
fi



AM_CONDITIONAL(SYSTEMBACKEND_POSIX, test x"$with_systembackend_posix" != xno)
AM_CONDITIONAL(SYSTEMBACKEND_PROC, test x"$with_systembackend_proc" != xno)
AM_CONDITIONAL(USERBACKEND_MYSQL, test x"$with_userbackend_mysql" != xno)


AC_CONFIG_FILES([
  Makefile
  libltdl/Makefile
  src/Makefile
  src/Client/Makefile
  src/Client/Requests/Makefile
  src/Common/Makefile
  src/Common/Requests/Makefile
  src/Common/RequestHandlers/Makefile
  src/Core/Makefile
  src/Core/Requests/Makefile
  src/Core/RequestHandlers/Makefile
  src/Daemon/Makefile
  src/Daemon/Backends/Makefile
  src/Daemon/Requests/Makefile
  src/Daemon/RequestHandlers/Makefile
  src/Net/Makefile
  src/Net/Packets/Makefile
  src/modules/Makefile
])

AC_OUTPUT