-
Notifications
You must be signed in to change notification settings - Fork 19
/
configure.ac
142 lines (125 loc) · 2.92 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
##
# Prologue.
##
AC_INIT([powerman],
m4_esyscmd([git describe --always | awk '/.*/ {sub(/^v/, ""); printf "%s",$1; exit}']))
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_MACRO_DIR([config])
AC_CONFIG_SRCDIR([NEWS.md])
AC_CANONICAL_TARGET
LT_INIT
##
# If runstatedir not explicitly set on command line, use '/run' as default
# N.B. runstatedir is not set at all in autoconf < 2.70.
##
if test "$runstatedir" = '${localstatedir}/run' || test -z "$runstatedir"; then
AC_SUBST([runstatedir],[/run])
fi
X_AC_EXPAND_INSTALL_DIRS
##
# Automake support.
##
AM_INIT_AUTOMAKE([subdir-objects foreign])
AM_SILENT_RULES([yes])
AC_CONFIG_HEADERS([config/config.h])
AM_MAINTAINER_MODE([enable])
##
# Checks for programs.
##
AC_PROG_CC
AX_COMPILER_VENDOR
AS_CASE($ax_cv_c_compiler_vendor,
[gnu], [
WARNING_CFLAGS="-Wall -Werror"
]
[clang], [
WARNING_CFLAGS="-Wall -Werror -Wno-unknown-warning-option -Wno-error=unknown-warning-option"
]
)
AC_SUBST([WARNING_CFLAGS])
AC_PROG_LN_S
AC_PROG_MAKE_SET
AC_PROG_LEX([noyywrap])
AS_IF([test "x$LEX" = "x:"],AC_MSG_ERROR([could not find flex]),[])
AC_PROG_YACC
# AC_PROG_YACC sets YACC=yacc when nothing is found, even yacc
# Just assume bison is the preferred compiler-compiler and call yacc a failure
AS_IF([test "x$YACC" = "xyacc"],AC_MSG_ERROR([could not find bison]),[])
AM_CONDITIONAL(WITH_GNU_LD, test "$with_gnu_ld" = "yes")
##
#
##
AC_CHECK_FILES(/dev/ptmx)
AC_CHECK_FILES(/dev/ptc)
##
# Checks for header files.
##
AC_CHECK_HEADERS( \
poll.h \
sys/select.h \
sys/syscall.h \
)
##
# Checks for typedefs, structures, and compiler characteristics.
##
AC_C_BIGENDIAN
AC_TYPE_UID_T
AC_C_CONST
AC_CHECK_TYPES(socklen_t, [], [], [#include <sys/socket.h>])
##
# Check for httppower, genders
##
AC_HTTPPOWER
AC_REDFISHPOWER
AC_SNMPPOWER
AC_GENDERS
##
# Check for systemd
##
RRA_WITH_SYSTEMD_UNITDIR
##
# Checks for library functions.
##
AC_SEARCH_LIBS([bind],[socket])
AC_SEARCH_LIBS([gethostbyaddr],[nsl])
AC_WRAP
AC_CHECK_FUNC([poll], AC_DEFINE([HAVE_POLL], [1], [Define if you have poll]))
# for list.c, cbuf.c, hostlist.c, and wrappers.c */
AC_DEFINE(WITH_LSD_FATAL_ERROR_FUNC, 1, [Define lsd_fatal_error])
AC_DEFINE(WITH_LSD_NOMEM_ERROR_FUNC, 1, [Define lsd_fatal_error])
# whether to install pkg-config file for API
AC_PKGCONFIG
# what user and group to run daemon as
AC_RUNAS
##
# Epilogue.
##
AC_CONFIG_FILES( \
Makefile \
examples/powerman_el72.spec \
src/Makefile \
src/liblsd/Makefile \
src/libczmq/Makefile \
src/libcommon/Makefile \
src/powerman/Makefile \
src/httppower/Makefile \
src/redfishpower/Makefile \
src/snmppower/Makefile \
src/plmpower/Makefile \
src/libtap/Makefile \
etc/Makefile \
etc/libpowerman.pc \
etc/powerman.service \
heartbeat/Makefile \
man/Makefile \
man/powerman.1 \
man/libpowerman.3 \
man/powerman.conf.5 \
man/powerman.dev.5 \
man/httppower.8 \
man/redfishpower.8 \
man/plmpower.8 \
man/powermand.8 \
t/Makefile \
)
AC_OUTPUT