-
Notifications
You must be signed in to change notification settings - Fork 16
/
configure.ac
126 lines (104 loc) · 3 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
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) 2018-2020 HAProxy Technologies])
AC_INIT([m4_esyscmd_s(basename ${PWD})], [m4_esyscmd_s(cat VERSION)], [[email protected]])
echo "*** configuring for ${PACKAGE_NAME} v${PACKAGE_VERSION} ***"
AC_PREFIX_DEFAULT([/usr])
AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([1.13])
AM_VARIABLES_INIT
AM_SILENT_RULES([yes])
AM_HOST
dnl Check for source directory.
dnl
AC_CONFIG_SRCDIR([src/main.c])
AC_CONFIG_HEADERS([config/config.h])
AM_PROG_PKGCONFIG
dnl Checking command line options.
dnl
AM_ENABLE_DEBUG
AM_ENABLE_GPROF
AM_ENABLE_THREADS
dnl
dnl Misc
dnl
AM_WITH_CURL
AM_WITH_LIBEV
dnl Checks for programs.
dnl
AC_PROG_CC
AC_PROG_INSTALL
dnl Checks for header files.
dnl
AC_CHECK_HEADERS([fcntl.h inttypes.h libgen.h stddef.h stdint.h stdlib.h string.h strings.h unistd.h])
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h])
AC_CHECK_HEADERS([sys/param.h sys/socket.h sys/time.h])
dnl Checks for typedefs, structures, and compiler characteristics.
dnl
AM_CHECK___DATE__
AM_CHECK___FUNC__
AM_CHECK___STDC__
AM_CHECK___ATTRIBUTE__
AC_CHECK_HEADER_STDBOOL
AC_C_INLINE
AC_TYPE_PID_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_UINT8_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AM_TYPE_BOOL_T
AM_TYPE_UNCHAR
AM_TYPE_USHORT
AM_TYPE_ULONG
AM_TYPE_UINT
dnl Checks for libraries.
dnl
AC_SEARCH_LIBS([socket], [socket])
AC_SEARCH_LIBS([inet_ntop], [nsl])
dnl Checks for library functions.
dnl
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_REALLOC
AC_FUNC_STRERROR_R
AC_CHECK_FUNCS([gettimeofday localtime_r])
AC_CHECK_FUNCS([memchr memset])
AC_CHECK_FUNCS([dup2 socket])
AC_CHECK_FUNCS([strcasecmp strncasecmp strchr strdup strndup strerror strtoll strtoull])
dnl Set the compiler flags
dnl
AM_PROG_CC_SET([-fno-strict-aliasing])
AM_CONDITIONAL([WANT_CURL], [test "${HAVE_CURL}" = "yes"])
AM_CONDITIONAL([WANT_DEBUG], [test "${enable_debug}" = "yes"])
AM_CONDITIONAL([WANT_LIBEV], [test "${HAVE_LIBEV}" = "yes"])
AM_CONDITIONAL([WANT_THREADS], [test "${HAVE_THREADS}" = "yes"])
AM_VARIABLES_SET
AM_VARIABLE_SET([SPOA_MIRROR_CPPFLAGS], [ ${CURL_CPPFLAGS} ${LIBEV_CPPFLAGS} ${THREADS_CPPFLAGS} ])
AM_VARIABLE_SET([SPOA_MIRROR_CFLAGS], [ ${CURL_CFLAGS} ${LIBEV_CFLAGS} ${THREADS_CFLAGS} ])
AM_VARIABLE_SET([SPOA_MIRROR_LDFLAGS], [ ${CURL_LDFLAGS} ${LIBEV_LDFLAGS} ${THREADS_LDFLAGS} ])
AM_VARIABLE_SET([SPOA_MIRROR_LIBS], [ ${CURL_LIBS} ${LIBEV_LIBS} ${THREADS_LIBS} ])
AC_SUBST([SPOA_MIRROR_CPPFLAGS])
AC_SUBST([SPOA_MIRROR_CFLAGS])
AC_SUBST([SPOA_MIRROR_LDFLAGS])
AC_SUBST([SPOA_MIRROR_LIBS])
dnl version.h
dnl
CONFIGURE_OPTIONS="${ac_configure_args}"
AC_SUBST([DATE])
AC_SUBST([PACKAGE_VERSION])
AC_SUBST([CONFIGURE_OPTIONS])
AC_CONFIG_FILES([Makefile src/Makefile util/Makefile include/common/version.h])
AC_OUTPUT
AM_SHOW_CONFIG
AH_TOP([
#ifndef _COMMON_CONFIG_H
#define _COMMON_CONFIG_H
])
AH_BOTTOM([
#endif /* _COMMON_CONFIG_H */
])