forked from mozy/mordor
-
Notifications
You must be signed in to change notification settings - Fork 5
/
configure.ac
128 lines (116 loc) · 3.51 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
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
119
120
121
122
123
124
125
126
127
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.61)
AC_INIT([libmordor],[1.3.0])
AM_INIT_AUTOMAKE
LT_INIT([disable-static])
AC_CONFIG_SRCDIR([mordor/fiber.cpp])
AC_CONFIG_HEADERS([autoconfig.h])
AC_CONFIG_MACRO_DIR([m4])
AC_SUBST([LIBMORDOR_SO_VERSION], [1:0:0])
AC_SUBST([LIBMORDOR_API_VERSION], [1])
# Checks for programs.
AC_PROG_CXX
AC_PROG_AWK
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
CHECK_RAGEL([mordor/uri.cpp], [6.0])
AC_CHECK_PROG([PROTOC], [protoc], [protoc])
# Checks for libraries.
AC_SEARCH_LIBS([pthread_create], [pthread])
AC_SEARCH_LIBS([clock_gettime], [rt])
AC_SEARCH_LIBS([backtrace], [execinfo])
AX_CHECK_OPENSSL
AX_CHECK_ZLIB
AX_BOOST_BASE([1.40],, [AC_ERROR([Missing boost headers (1.40+)])])
AX_BOOST_PROGRAM_OPTIONS
AX_BOOST_REGEX
AX_BOOST_SYSTEM
AX_BOOST_THREAD
AX_CHECK_CORESERVICES_FRAMEWORK
AX_CHECK_COREFOUNDATION_FRAMEWORK
AX_CHECK_SECURITY_FRAMEWORK
AX_CHECK_SYSTEMCONFIGURATION_FRAMEWORK
AX_LIB_POSTGRESQL
AM_CONDITIONAL([HAVE_POSTGRESQL], [test "x${POSTGRESQL_VERSION}" != x])
AC_ARG_WITH(yaml,
[AS_HELP_STRING([--with-yaml=[[ARG]]],
[Enable YAML parsing support @<:@default=check@:>@])],
[],
[with_yaml=check])
LIBYAML=
AS_IF([test "x$with_yaml" != xno],
[AC_CHECK_LIB([yaml], [yaml_parser_initialize],
[AC_SUBST([LIBYAML], ["-lyaml"])
AC_DEFINE([HAVE_LIBYAML], [1],
[Define if you have libyaml])
AM_CONDITIONAL([HAVE_LIBYAML], true)
],
[AM_CONDITIONAL([HAVE_LIBYAML], false)
if test "x$with_yaml" != xcheck; then
AC_MSG_FAILURE(
[--with-yaml was given, but test for libyaml failed])
fi
])],
[AM_CONDITIONAL([HAVE_LIBYAML], false)])
AC_ARG_WITH([protobuf],
AS_HELP_STRING([--with-protobuf],
[Enable Protobuf parsing and serialization support @<:@default=check@:>@])],
[],
[with_protobuf=check])
AS_IF([test "x$with_protobuf" = xyes],
[PKG_CHECK_MODULES([PROTOBUF], [protobuf])],
[test "x$with_protobuf" = xcheck],
[PKG_CHECK_MODULES([PROTOBUF], [protobuf], [], [true])])
AM_CONDITIONAL([HAVE_PROTOBUF], [test "x${PROTOBUF_CFLAGS}" != x])
AC_ARG_WITH(ssh2,
[AS_HELP_STRING([--with-ssh2=[[ARG]]],
[Enable ssh library @<:@default=check@:>@])],
[],
[with_ssh2=check])
LIBSSH2=
AS_IF([test "x$with_ssh2" != xno],
[AC_CHECK_LIB([ssh2], [libssh2_init],
[AC_SUBST([LIBSSH2], ["-lssh2"])
AC_DEFINE([HAVE_LIBSSH2], [1],
[Define if you have libssh2])
AM_CONDITIONAL([HAVE_LIBSSH2], true)
],
[AM_CONDITIONAL([HAVE_LIBSSH2], false)
if test "x$with_ssh2" != xcheck; then
AC_MSG_FAILURE(
[--with-ssh2 was given, but test for libssh2 failed])
fi
])],
[AM_CONDITIONAL([HAVE_LIBSSH2], false)])
# Checks for header files.
AC_CHECK_HEADERS([fcntl.h netdb.h netinet/in.h stddef.h stdint.h stdlib.h string.h sys/socket.h sys/time.h syslog.h valgrind/valgrind.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_ASSERT
AC_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_CHECK_TYPES([ptrdiff_t])
# Checks for library functions.
AC_FUNC_ERROR_AT_LINE
AC_HEADER_MAJOR
AC_FUNC_MMAP
AC_FUNC_STRTOD
AC_CHECK_FUNCS([clock_gettime ftruncate memchr memmove memset munmap rmdir socket strchr strstr strtoull])
AC_SUBST([pic_flag])
AC_CONFIG_FILES([Makefile
mordor/libmordor.pc
mordor/libmordorprotobuf.pc
mordor/libmordoryaml.pc
mordor/pq/libmordorpq.pc
mordor/test/libmordortest.pc])
AC_OUTPUT