forked from lightstep/lightstep-tracer-cpp
/
configure.ac
72 lines (53 loc) · 2.01 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
# -*- Autoconf -*-
#
# TODO On Mac OS X building against "keg-only" libraries installed
# by homebrew, see the commands to set PKG_CONFIG_PATH in build.sh.
AC_PREREQ([2.69])
AC_INIT([lightstep-tracer-cpp], [0.36],
[https://github.com/lightstep/lightstep-tracer-cpp/issues])
LT_INIT([disable-shared])
AM_INIT_AUTOMAKE([1.14 foreign subdir-objects])
AC_CONFIG_SRCDIR([src/c++11])
AC_CONFIG_HEADERS([src/c++11/config.h])
AC_CONFIG_MACRO_DIRS([m4])
AC_LANG_PUSH([C++])
AC_PROG_CXX
AX_CXX_COMPILE_STDCXX([11])
AS_IF([test -z "${protobuf_LIBS}"],
[PKG_CHECK_MODULES(protobuf, protobuf >= 3.0.0)])
SAVE_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${protobuf_CFLAGS}"
AC_CHECK_HEADER(google/protobuf/message.h)
CPPFLAGS="${SAVE_CPPFLAGS}"
AC_ARG_VAR(protobuf_LIBS, "Libs for protobuf")
AC_ARG_VAR(protobuf_CFLAGS, "CFLAGS for protobuf")
AC_CACHE_VAL(protobuf_cv_PREFIX, [protobuf_cv_PREFIX=`$PKG_CONFIG --variable=prefix protobuf`])
AS_IF([test -z "${PROTOC}"],
[PROTOC="$protobuf_cv_PREFIX/bin/protoc"])
AC_ARG_VAR(PROTOC, "Location of the protocol compiler")
AC_ARG_ENABLE([grpc],
[AS_HELP_STRING([--disable-grpc],
[Enable gRPC networking @<:@yes@:>@])],
[:],
[enable_grpc=check])
AS_IF([test "${enable_grpc}" != "no"],
[AS_IF([test -z "${grpc_LIBS}"],
[PKG_CHECK_MODULES(grpc, grpc >= 1.0.0)])
AC_ARG_VAR(grpc_LIBS, "LIBS for gRPC")
AC_ARG_VAR(grpc_CFLAGS, "CFLAGS for gRPC")
])
SAVE_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="${CPPFLAGS} ${grpc_CFLAGS}"
AS_IF([test "$enable_grpc" != "no"],
[AC_CHECK_HEADER(grpc++/grpc++.h,
[AC_DEFINE(HAVE_GRPC,[],[Defined if grpc is available])
enable_grpc=yes],
[AS_IF([test "$enable_grpc" != "no"],
[AC_MSG_ERROR([gRPC support requested, but not found.])],
[enable_grpc=no])])])
CPPFLAGS="${SAVE_CPPFLAGS}"
AM_CONDITIONAL([ENABLE_GRPC], [test "$enable_grpc" = "yes"])
AC_LANG_POP([C++])
AC_CHECK_HEADERS([unistd.h])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile src/c++11/Makefile test/c++11/Makefile])
AC_OUTPUT