-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.ac
69 lines (60 loc) · 2 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## Process this file with autoconf to produce configure.
## In general, the safest way to proceed is to run ./autogen.sh
AC_PREREQ(2.59)
AC_INIT([evcollect],[0.1.0-dev],[[email protected]],[mysql2evql])
AM_INIT_AUTOMAKE([foreign subdir-objects serial-tests])
AM_MAINTAINER_MODE([enable])
AC_CONFIG_SRCDIR([configure.ac])
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
# Check for build env
AC_PROG_CC
AC_PROG_CXX
AM_PROG_AS
AM_PROG_AR
AC_PROG_RANLIB
# Check for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h inttypes.h limits.h stdlib.h unistd.h syslog.h])
AM_CONDITIONAL([HAVE_SYSLOG_H], [test x$HAVE_SYSLOG_H = x1])
# Check for library functions
AC_FUNC_MEMCMP
AC_FUNC_STRTOD
AC_CHECK_FUNCS([ftruncate memset mkdir strchr strerror strtol gethostbyname_r])
AM_CONDITIONAL([HAVE_GETHOSTBYNAME_R], [test x$HAVE_GETHOSTBYNAME_R = x1])
# Check for zlib
HAVE_ZLIB=0
AS_IF([test "$with_zlib" != no], [
AC_MSG_CHECKING([zlib version])
# First check the zlib header version
AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[
#include <zlib.h>
#if !defined(ZLIB_VERNUM) || (ZLIB_VERNUM < 0x1204)
# error zlib version too old
#endif
]], [])], [
AC_MSG_RESULT([ok (1.2.0.4 or later)])
# Also need to add -lz to the linker flags and make sure this succeeds.
AC_SEARCH_LIBS([zlibVersion], [z], [
AC_DEFINE([HAVE_ZLIB], [1], [Enable classes using zlib compression.])
HAVE_ZLIB=1
], [
AS_IF([test "$with_zlib" != check], [
AC_MSG_FAILURE([--with-zlib was given, but no working zlib library was found])
])
])
], [
AS_IF([test "$with_zlib" = check], [
AC_MSG_RESULT([headers missing or too old (requires 1.2.0.4)])
], [
AC_MSG_FAILURE([--with-zlib was given, but zlib headers were not present or were too old (requires 1.2.0.4)])
])
])
])
AM_CONDITIONAL([HAVE_ZLIB], [test $HAVE_ZLIB = 1])
# Check for pthread
ACX_PTHREAD
AM_CONDITIONAL([HAVE_PTHREAD], [test "x$acx_pthread_ok" = "xyes"])
AC_CONFIG_FILES([Makefile])
AC_OUTPUT