-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathconfigure.ac
More file actions
183 lines (152 loc) · 4.66 KB
/
configure.ac
File metadata and controls
183 lines (152 loc) · 4.66 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
173
174
175
176
177
178
179
180
181
182
183
dnl Process this file with autoconf to produce a configure script.
dnl
dnl configure.ac - Miroslav Zagorac <mzagorac@haproxy.com>
AC_PREREQ([2.69])
AC_COPYRIGHT([Copyright (C) 2026 HAProxy Technologies])
AC_INIT([opentelemetry-c-wrapper], m4_esyscmd_s(awk '/Package/ { print $3 }' VERSION), [mzagorac@haproxy.com], [], [https://github.com/haproxytech/opentelemetry-c-wrapper])
AC_CONFIG_MACRO_DIR([m4])
AX_VARIABLE_SET([LIB_VERSION], [m4_esyscmd_s([awk '/Library/ { print $3 }' VERSION])])
AX_VARIABLE_SET([PACKAGE_BUILD], [m4_esyscmd_s([cat src/.build-counter])])
echo "*** configuring for ${PACKAGE_NAME} v${PACKAGE_VERSION}, lib v${LIB_VERSION} ***"
AC_PREFIX_DEFAULT([/usr])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([1.13])
AM_SILENT_RULES([yes])
AX_VARIABLES_INIT
AX_HOST
dnl Check for source directory.
dnl
AC_CONFIG_SRCDIR([src/tracer.cpp])
AC_CONFIG_HEADERS([config/config.h])
AX_INIT_PKGCONFIG
dnl Set the compiler, preprocessor, and file extensions.
dnl
AC_LANG([C])
m4_ifndef(
[AX_CHECK_COMPILE_FLAG],
[m4_fatal([AX_CHECK_COMPILE_FLAG is required. Install autoconf-archive.])]
)
dnl Checking command line options.
dnl
AX_ENABLE_DEBUG
AX_ENABLE_WARNINGS
AX_ENABLE_GPROF
AX_ENABLE_THREADS
dnl
dnl Misc
dnl
AC_ARG_WITH([libfyaml],
[AS_HELP_STRING([--with-libfyaml@<:@=DIR@:>@], [use libfyaml library @<:@default=no@:>@])],
[],
[with_libfyaml=no]
)
AC_ARG_WITH([rapidyaml],
[AS_HELP_STRING([--with-rapidyaml@<:@=DIR@:>@], [use rapidyaml library @<:@default=check@:>@])],
[],
[with_rapidyaml=check]
)
AS_IF(
[test "${with_libfyaml}" != "no" && test "${with_rapidyaml}" != "check" && test "${with_rapidyaml}" != "no"],
[AC_MSG_ERROR([options --with-libfyaml and --with-rapidyaml cannot be used at the same time])],
[]
)
AS_IF(
[test "${with_libfyaml}" != "no"],
[with_rapidyaml="no"],
[
AS_IF(
[test "${with_rapidyaml}" = "check"],
[with_rapidyaml="yes"],
[]
)
]
)
dnl Checks for programs.
dnl
AC_PROG_AWK
AC_PROG_CXX
AC_PROG_CC
AC_PROG_CPP
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
dnl Initialize libtool
dnl
LT_INIT([])
AC_SUBST([LIBTOOL_DEPS])
dnl Checks for header files.
dnl
AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h sched.h stdint.h stdlib.h string.h strings.h sys/time.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_C_INLINE
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
dnl Checks for libraries.
dnl
AX_WITH_LIBFYAML
AX_WITH_RAPIDYAML
AX_WITH_ABSEIL
AX_WITH_OPENTELEMETRY
dnl Checks for library functions.
dnl
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_FUNC_STRNLEN
AC_FUNC_STRTOD
AC_CHECK_FUNCS([clock_gettime gettimeofday mallinfo mallinfo2 memset strcasecmp strdup strndup strrchr strstr strtol])
dnl Set the compiler flags
dnl
AX_PROG_CC_SET([])
AX_PROG_CXX_SET([])
AX_CXX_COMPILE_STDCXX([17], [ext], [mandatory])
AM_CONDITIONAL([WANT_DEBUG], [test "${enable_debug}" = "yes"])
AX_VARIABLES_SET
AX_VARIABLE_SET([OPENTELEMETRY_C_WRAPPER_CPPFLAGS], [ ${THREADS_CPPFLAGS} ${LIBFYAML_CPPFLAGS} ${RAPIDYAML_CPPFLAGS} ])
AX_VARIABLE_SET([OPENTELEMETRY_C_WRAPPER_CFLAGS], [ ${THREADS_CFLAGS} ${LIBFYAML_CFLAGS} ${RAPIDYAML_CFLAGS} ])
AX_VARIABLE_SET([OPENTELEMETRY_C_WRAPPER_LDFLAGS], [ ${THREADS_LDFLAGS} ${LIBFYAML_LDFLAGS} ${RAPIDYAML_LDFLAGS} ])
AX_VARIABLE_SET([OPENTELEMETRY_C_WRAPPER_LIBS], [ ${THREADS_LIBS} ${LIBFYAML_LIBS} ${RAPIDYAML_LIBS} ])
AC_SUBST([OPENTELEMETRY_C_WRAPPER_CPPFLAGS])
AC_SUBST([OPENTELEMETRY_C_WRAPPER_CFLAGS])
AC_SUBST([OPENTELEMETRY_C_WRAPPER_LDFLAGS])
AC_SUBST([OPENTELEMETRY_C_WRAPPER_LIBS])
dnl Libs.private for pkg-config (transitive deps for static linking).
dnl
LIBS_PRIVATE="${OPENTELEMETRY_LDFLAGS} ${OPENTELEMETRY_LIBS} ${OPENTELEMETRY_SYSLDFLAGS} ${OPENTELEMETRY_SYSLIBS} ${LIBFYAML_LDFLAGS} ${LIBFYAML_LIBS} ${RAPIDYAML_LDFLAGS} ${RAPIDYAML_LIBS} ${THREADS_LDFLAGS} ${THREADS_LIBS}"
AC_SUBST([LIBS_PRIVATE])
dnl version.h
dnl
CONFIGURE_OPTIONS="${ac_configure_args}"
AC_SUBST([DATE])
AC_SUBST([PACKAGE_VERSION])
AC_SUBST([PACKAGE_BUILD])
AC_SUBST([LIB_VERSION])
AC_SUBST([CONFIGURE_OPTIONS])
dnl src/Makefile test/Makefile
dnl
COMMON_CPPFLAGS='-I$(top_builddir)/include -I$(top_srcdir)/include'
AC_SUBST([COMMON_CPPFLAGS])
dnl otel_cpp.h
dnl
AX_OTEL_CPP_HDR_SEMANTIC_CONVENTIONS
AX_OTEL_CPP_HDR_SPAN_KIND
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile])
AC_CONFIG_FILES([include/opentelemetry-c-wrapper/version.h include/opentelemetry-c-wrapper/otel_cpp.h])
AC_CONFIG_FILES([opentelemetry-c-wrapper.pc opentelemetry-c-wrapper_dbg.pc])
AC_OUTPUT
AX_SHOW_CONFIG
AH_TOP([
#ifndef _COMMON_CONFIG_H
#define _COMMON_CONFIG_H
])
AH_BOTTOM([
#endif /* _COMMON_CONFIG_H */
])