-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.ac
118 lines (94 loc) · 2.85 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
dnl Process this file with autoconf to produce a configure script.
dnl
dnl configure.ac - Miroslav Zagorac <[email protected]>
AC_PREREQ([2.69])
AC_COPYRIGHT([Copyright (C) 2020 HAProxy Technologies])
AC_INIT(m4_esyscmd_s([basename ${PWD}]), m4_esyscmd_s([awk '/Package/ { print $3 }' VERSION]), [[email protected]])
AC_CONFIG_MACRO_DIR([m4])
AX_VARIABLE_SET([LIB_VERSION], m4_esyscmd_s([awk '/Library/ { print $3 }' VERSION]))
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])
AX_VARIABLES_INIT
AM_SILENT_RULES([yes])
AX_HOST
dnl Check for source directory.
dnl
AC_CONFIG_SRCDIR([src/tracer.cpp])
AC_CONFIG_HEADERS([config/config.h])
AX_PROG_PKGCONFIG
PKG_INSTALLDIR
dnl Set the compiler, preprocessor, and file extensions.
dnl
AC_LANG([C])
dnl Checking command line options.
dnl
AX_ENABLE_DEBUG
AX_ENABLE_GPROF
AX_ENABLE_THREADS
dnl
dnl Misc
dnl
AX_WITH_OPENTRACING
dnl Checks for programs.
dnl
AC_PROG_CXX
AC_PROG_CC
AC_PROG_INSTALL
dnl Initialize libtool
dnl
LT_INIT
dnl Checks for header files.
dnl
AC_CHECK_HEADERS([fcntl.h inttypes.h malloc.h stdint.h stdlib.h string.h sys/time.h unistd.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AC_CHECK_HEADER_STDBOOL
AC_TYPE_UINT8_T
AC_TYPE_INT64_T
AC_TYPE_UINT64_T
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
dnl Checks for libraries.
dnl
dnl Checks for library functions.
dnl
AC_FUNC_ERROR_AT_LINE
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([clock_gettime gettimeofday memmove memset strchr strdup strndup])
AC_CHECK_FUNCS([mallinfo])
dnl Set the compiler flags
dnl
AX_PROG_CC_SET([])
AX_PROG_CXX_SET([])
AM_CONDITIONAL([WANT_DEBUG], [test "${enable_debug}" = "yes"])
AX_VARIABLES_SET
AX_VARIABLE_SET([OPENTRACING_C_WRAPPER_CPPFLAGS], [ ${OPENTRACING_CPPFLAGS} ${THREADS_CPPFLAGS} ])
AX_VARIABLE_SET([OPENTRACING_C_WRAPPER_CFLAGS], [ ${OPENTRACING_CFLAGS} ${THREADS_CFLAGS} ])
AX_VARIABLE_SET([OPENTRACING_C_WRAPPER_CXXFLAGS], [ ${OPENTRACING_CXXFLAGS} ${THREADS_CXXFLAGS} ])
AX_VARIABLE_SET([OPENTRACING_C_WRAPPER_LDFLAGS], [ ${OPENTRACING_LDFLAGS} ${THREADS_LDFLAGS} ])
AX_VARIABLE_SET([OPENTRACING_C_WRAPPER_LIBS], [ ${OPENTRACING_LIBS} ${THREADS_LIBS} ])
AC_SUBST([OPENTRACING_C_WRAPPER_CPPFLAGS])
AC_SUBST([OPENTRACING_C_WRAPPER_CFLAGS])
AC_SUBST([OPENTRACING_C_WRAPPER_CXXFLAGS])
AC_SUBST([OPENTRACING_C_WRAPPER_LDFLAGS])
AC_SUBST([OPENTRACING_C_WRAPPER_LIBS])
dnl version.h
dnl
CONFIGURE_OPTIONS="${ac_configure_args}"
AC_SUBST([DATE])
AC_SUBST([PACKAGE_VERSION])
AC_SUBST([LIB_VERSION])
AC_SUBST([CONFIGURE_OPTIONS])
AC_CONFIG_FILES([Makefile src/Makefile test/Makefile include/version.h opentracing-c-wrapper.pc opentracing-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 */
])