-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
51 lines (41 loc) · 1.3 KB
/
configure.ac
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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
m4_include(libcurl.m4)
m4_include(mysql.m4)
AC_PREREQ([2.68])
AC_INIT([mal_daemon], [0.1], [[email protected]])
AM_INIT_AUTOMAKE
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_PROG_CXX
AC_PROG_CC
# Checks for libraries.
AC_CHECK_LIB([pthread], [pthread_create], [], [AC_MSG_ERROR([POSIX thread library is required])])
LIBCURL_CHECK_CONFIG([],[7.32],[],[AC_MSG_ERROR([libcurl is required])])
CXXFLAGS="$CXXFLAGS $LIBCURL_CPPFLAGS"
CFLAGS="$CFLAGS $LIBCURL_CPPFLAGS"
LIBS="$LIBS $LIBCURL"
# Checks for header files.
AC_CHECK_HEADERS([ \
stdio.h \
stdlib.h \
stdarg.h \
time.h \
string.h
])
AC_CHECK_HEADER([pthread.h],[AC_DEFINE(PTHREAD_HAVE, [1] ,[ Define to 1 if you have the <pthread.h> header file])])
MYSQL_CLIENT([],[client])
CFLAGS="$CFLAGS $MYSQL_CLIENT_CFLAGS"
LIBS="$LIBS $MYSQL_CLIENT_LIBS"
PKG_CHECK_MODULES([LIBCONFIG], [libconfig >= 1.4],,
AC_MSG_ERROR([libconfig 1.4 or newer not found.])
)
CFLAGS="$CFLAGS $LIBCONFIG_CFLAGS"
LIBS="$LIBS $LIBCONFIG_LIBS"
PKG_CHECK_MODULES(LIBXML, libxml-2.0 >= 2.4,,
AC_MSG_ERROR([libxml-2.0 2.4 or newer not found.])
)
CFLAGS="$CFLAGS $LIBXML_FLAGS"
LIBS="$LIBS $LIBXML_LIBS"
AC_CONFIG_FILES([Makefile])
AC_OUTPUT