-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
132 lines (112 loc) · 4.09 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
128
129
130
131
132
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_CONFIG_MACRO_DIR([./aclocal])
AC_INIT([thrift-nicejson], [0.01], [[email protected]])
AM_INIT_AUTOMAKE([subdir-objects tar-ustar])
AC_CONFIG_SRCDIR([config.h.in])
AC_CONFIG_HEADERS([config.h])
AC_LANG([C++])
m4_include([aclocal/ax_cxx_compile_stdcxx.m4])
AX_CXX_COMPILE_STDCXX(11)
LT_INIT
#AX_CXX_COMPILE_STDCXX([11], [noext], [optional])
# Checks for programs.
AC_PROG_CXX
AC_PROG_CC
AC_PROG_RANLIB
# Checks for libraries.
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES([thrift], [thrift >= 0.10.0])
AC_SUBST([thrift_LIBDIR], [$(pkg-config --variable=libdir --print-errors "thrift >= 0.10.0")])
AC_SUBST([thrift_EXEC_PREFIX], [$(pkg-config --variable=exec_prefix --print-errors "thrift >= 0.10.0")])
AC_SUBST([thrift_INCLUDEDIR], [$(pkg-config --variable=includedir --print-errors "thrift >= 0.10.0")])
AX_BOOST_BASE([1.53.0],, [AC_MSG_ERROR([libnicejson needs Boost, but it was not found in your system])])
AX_BOOST_SYSTEM
AX_BOOST_FILESYSTEM
AX_BOOST_THREAD
AX_BOOST_PROGRAM_OPTIONS
AC_SUBST([BOOST_LIB_DIR], [$(echo "$BOOST_LDFLAGS" | sed -e 's/^\-L//')])
AC_SUBST([BOOST_FILESYSTEM_LDADD], [$(echo "-lboost_filesystem")])
AC_SUBST([BOOST_SYSTEM_LDADD], [$(echo "-lboost_system")])
AC_SUBST([BOOST_THREAD_LDADD], [$(echo "-lboost_thread")])
AC_ARG_WITH([thrift-srcdir],
[AS_HELP_STRING([--with-thrift-srcdir],
[Directory to the (required) out-of-tree Thrift source])],,
[AC_MSG_FAILURE([MUST specify out-of-tree Thrift source directory])])
AC_SUBST([THRIFT_SRC_ROOT],[$withval])
AC_ARG_WITH([googletest-dir],
[AS_HELP_STRING([--with-googletest-dir],
[Directory to the (required) out-of-tree googletest dir (containing src/gtest_main.cc)])],,
[AC_MSG_FAILURE([MUST specify out-of-tree googletest directory])])
AC_SUBST([GTEST_DIR],[$withval])
AC_ARG_VAR([PY_PREFIX], [Prefix for installing Python modules.
(Normal --prefix is ignored for Python because
Python has different conventions.)
Default = "/usr"])
AS_IF([test "x$PY_PREFIX" = x], [PY_PREFIX="/usr"])
# Find python regardless of with_python value, because it's needed by make cross
AM_PATH_PYTHON(2.6,, :)
AX_THRIFT_LIB(python, [Python], no)
if test "$with_python" = "yes"; then
if test -n "$PYTHON"; then
have_python="yes"
fi
fi
AM_CONDITIONAL(WITH_PYTHON, [test "$have_python" = "yes"])
AC_PROG_OCAML
AC_PROG_FINDLIB
AC_CHECK_OCAML_PKG([result])
AC_CHECK_OCAML_PKG([oUnit])
AC_CHECK_OCAML_PKG([yojson])
AC_CHECK_OCAML_PKG([thrift])
AC_CHECK_OCAML_PKG([cppffigen])
if test "$OCAMLC" != "no"; then
if test "$OCAMLFIND" = "no" ; then
AC_MSG_ERROR([Please install OCaml findlib (the ocamlfind command)])
fi
if test "$OCAML_PKG_result" = "no" ; then
AC_MSG_ERROR([Please install OCaml package 'result'.])
fi
if test "$OCAML_PKG_oUnit" = "no" ; then
AC_MSG_ERROR([Please install OCaml package 'oUnit'.])
fi
if test "$OCAML_PKG_cppffigen" = "no" ; then
AC_MSG_ERROR([Please install OCaml package 'cppffigen'.])
fi
fi
AX_THRIFT_LIB(ocaml, [Ocaml], no)
if test "$with_ocaml" = "yes"; then
if test "$OCAMLC" != "no"; then
have_ocaml="yes"
fi
fi
AM_CONDITIONAL(WITH_OCAML, [test "$have_ocaml" = "yes"])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INT8_T
AC_TYPE_SIZE_T
AC_TYPE_UINT32_T
AC_TYPE_UINT8_T
# Checks for library functions.
AC_CONFIG_FILES([Makefile
src/gtest/Makefile
src/lib/cpp/Makefile
src/lib/py/Makefile
src/lib/ocaml/Makefile
src/plugins/cpp/Makefile
src/plugins/ocaml/Makefile
src/test/cpp/Makefile
src/test/py/Makefile
src/test/ocaml/Makefile
src/examples/cpp/Makefile
src/examples/py/Makefile
src/examples/ocaml/Makefile
src/tools/cpp/Makefile
src/tools/ocaml/Makefile])
AC_OUTPUT