-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
172 lines (147 loc) · 6.18 KB
/
Copy pathconfigure.ac
File metadata and controls
172 lines (147 loc) · 6.18 KB
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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
# Copyright (c) 2011-2026 Cisco Systems, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
# MA 02110-1301, USA.
AC_PREREQ([2.61])
m4_include([common_m4/versions.m4])
AC_INIT([api], API_VERSION_NUMBER, [https://sourceforge.net/apps/trac/razorbacktm/])
AC_CONFIG_AUX_DIR([.])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([src/thread.c])
AC_CONFIG_HEADERS([config.h])
AM_INIT_AUTOMAKE([foreign no-define tar-ustar subdir-objects])
APIVERSION=API_LIB_VERSION_NUMBER
# Pull in the checks for the build tools.
m4_include([common_m4/build_tools.m4])
AC_PROG_CXX
LT_LANG([C++])
AC_LANG_PUSH([C++])
saved_CXXFLAGS="$CXXFLAGS"
CXX23_CXXFLAGS="-std=c++23"
CXXFLAGS="$saved_CXXFLAGS $CXX23_CXXFLAGS"
AC_CACHE_CHECK([whether $CXX supports C++23],
[rb_cv_cxx23],
[AC_COMPILE_IFELSE(
[AC_LANG_PROGRAM([[#include <stdatomic.h>]],
[[atomic_bool enabled = false;
return atomic_load(&enabled);]])],
[rb_cv_cxx23=yes],
[rb_cv_cxx23=no])])
AS_IF([test "x$rb_cv_cxx23" != "xyes"], [
AC_MSG_ERROR([a C++23-capable compiler is required])
])
AC_LANG_POP([C++])
# Pull in the platform specific build/configure environment options.
m4_include([common_m4/platform_flags.m4])
# Pull in the dependancies on on the API (use the nugget way).
m4_include([common_m4/api_deps.m4])
AC_CHECK_LIB([z], [compress2], [], [ZLIB="no"])
AS_IF([test "x$ZLIB" = "xno"],
[AC_MSG_ERROR("zlib library not found")]
)
AC_CHECK_HEADERS([zlib.h], [], [ZLIB_HEADER="no"])
AS_IF([test "x$ZLIB_HEADER" = "xno"],
[AC_MSG_ERROR("zlib header file not found")]
)
AC_CHECK_LIB([yaml], [yaml_parser_initialize], [], [YAML="no"])
AS_IF([test "x$YAML" = "xno"],
[AC_MSG_ERROR("libyaml library not found")]
)
AC_CHECK_HEADERS([yaml.h], [], [YAML_HEADER="no"])
AS_IF([test "x$YAML_HEADER" = "xno"],
[AC_MSG_ERROR("libyaml header file not found")]
)
# Pull in the standard header and function checks.
m4_include([common_m4/standard_headers_functions.m4])
# Pull in the standard options for all components
m4_include([common_m4/standard_options.m4])
AC_ARG_ENABLE([cnc_debug], [AS_HELP_STRING([--enable-cnc-debug],[Enable command and control debug])], [enable_cnc_debug=$enableval], [enable_cnc_debug="no"])
if test "x$enable_cnc_debug" = "xyes"; then
AC_DEFINE([CNC_DEBUG], 1, [Command and Control Debug Mode])
fi
AC_ARG_ENABLE([stomp_debug], [AS_HELP_STRING([--enable-stomp-debug],[Enable stomp debug])], [enable_stomp_debug=$enableval], [enable_stomp_debug="no"])
if test "x$enable_stomp_debug" = "xyes"; then
AC_DEFINE([STOMP_DEBUG], 1, [Stomp Debug Mode])
fi
AC_ARG_ENABLE([magic_debug], [AS_HELP_STRING([--enable-magic-debug],[Enable magic debug])], [enable_magic_debug=$enableval], [enable_magic_debug="no"])
if test "x$enable_magic_debug" = "xyes"; then
AC_DEFINE([MIME_MAGIC_DEBUG], 1, [Magic Debug Mode])
fi
AC_ARG_ENABLE([list_debug], [AS_HELP_STRING([--enable-list-debug],[Enable list debug])], [enable_list_debug=$enableval], [enable_list_debug="no"])
if test "x$enable_list_debug" = "xyes"; then
AC_DEFINE([LIST_DEBUG], 1, [List Debug Mode])
fi
#m4_include([libssh/configure.m4])
AC_CHECK_HEADERS([sys/endian.h], [], [SYS_ENDIAN_HEADER="no"])
# Pull in the compiler customisation options for different compilers.
m4_include([common_m4/compiler_options.m4])
# Pull in the standard compiler and linker flags.
m4_include([common_m4/cflags.m4])
AC_DEFINE_UNQUOTED(NUGGET_SO_VERSION, "[NUGGET_VERSION_NUMBER]", ["So Version Of Nuggets"])
AS_AC_EXPAND(LIBDIR, "$libdir")
libdir=$LIBDIR
AC_DEFINE_UNQUOTED(LIB_DIR, "$LIBDIR", ["Lib dir"])
PKG_CHECK_MODULES([CHECK], [check >= 0.15.2], [have_check=yes], [have_check=no])
AM_CONDITIONAL([HAVE_CHECK], [test "x$have_check" = "xyes"])
AS_IF([test "x$have_check" != "xyes"], [
AC_MSG_WARN([libcheck not found; unit tests will not be built])
])
if test "x$prefix" != "xNONE"; then
PKG_CONFIG_PATH="$prefix/lib/pkgconfig:$prefix/lib64/pkgconfig:$PKG_CONFIG_PATH"
export PKG_CONFIG_PATH
fi
PKG_CHECK_MODULES([OPENTELEMETRY_CPP],
[opentelemetry_common
opentelemetry_resources
opentelemetry_trace
opentelemetry_metrics
opentelemetry_logs
opentelemetry_otlp_recordable
opentelemetry_exporter_otlp_http_client
opentelemetry_exporter_otlp_http
opentelemetry_exporter_otlp_http_log
opentelemetry_exporter_otlp_http_metric],
[have_opentelemetry_cpp=yes],
[have_opentelemetry_cpp=no])
AS_IF([test "x$have_opentelemetry_cpp" != "xyes"], [
AC_MSG_ERROR([opentelemetry-cpp OTLP HTTP support is required; install the SDK, OTLP HTTP exporters, and their pkg-config metadata])
])
PKG_CHECK_MODULES([PROTOBUF], [protobuf], [], [
AC_MSG_ERROR([protobuf is required to link opentelemetry-cpp OTLP exporters])
])
OPENTELEMETRY_CPP_LIBS="-Wl,--no-as-needed $OPENTELEMETRY_CPP_LIBS -lopentelemetry_proto -lopentelemetry_http_client_curl $PROTOBUF_LIBS -Wl,--as-needed"
AC_PATH_PROG([JV], [jv], [])
AM_CONDITIONAL([HAVE_JV], [test -n "$JV"])
AS_IF([test -z "$JV"], [
AC_MSG_WARN([jv command not found in PATH])
])
AC_SUBST(XCCFLAGS)
AC_SUBST(APIVERSION)
AC_SUBST(JV)
AC_SUBST(LIBS)
AC_SUBST(extra_incl)
AC_SUBST(OPENTELEMETRY_CPP_CFLAGS)
AC_SUBST(OPENTELEMETRY_CPP_LIBS)
AC_CONFIG_FILES([ \
razorback.pc \
Makefile \
m4/Makefile \
etc/Makefile \
include/Makefile \
src/Makefile \
share/Makefile \
share/razorback/Makefile \
tests/Makefile \
])
AC_OUTPUT