forked from ClusterLabs/sbd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
210 lines (176 loc) · 6.29 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
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
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
dnl
dnl autoconf for Agents
dnl
dnl License: GNU General Public License (GPL)
dnl ===============================================
dnl Bootstrap
dnl ===============================================
AC_PREREQ(2.63)
dnl Suggested structure:
dnl information on the package
dnl checks for programs
dnl checks for libraries
dnl checks for header files
dnl checks for types
dnl checks for structures
dnl checks for compiler characteristics
dnl checks for library functions
dnl checks for system services
AC_INIT([sbd],
[1.2.1],
AC_CANONICAL_HOST
AC_CONFIG_AUX_DIR(.)
AC_CONFIG_HEADERS(config.h)
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([no])])
AM_INIT_AUTOMAKE
AM_PROG_CC_C_O
PKG_CHECK_MODULES(glib, [glib-2.0])
dnl PKG_CHECK_MODULES(libcoroipcc, [libcoroipcc])
dnl pacemaker > 1.1.8
PKG_CHECK_MODULES(pacemaker, [pacemaker, pacemaker-cib], HAVE_pacemaker=1, HAVE_pacemaker=0)
dnl pacemaker <= 1.1.8
PKG_CHECK_MODULES(pcmk, [pcmk, pcmk-cib], HAVE_pcmk=1, HAVE_pcmk=0)
PKG_CHECK_MODULES(libqb, [libqb])
CPPFLAGS="$CPPFLAGS -Werror"
if test $HAVE_pacemaker = 0 -a $HAVE_pcmk = 0; then
AC_MSG_ERROR(No package 'pacemaker' found)
elif test $HAVE_pacemaker = 1; then
CPPFLAGS="$CPPFLAGS $glib_CFLAGS $pacemaker_CFLAGS"
fi
PKG_CHECK_MODULES(libxml, [libxml-2.0])
CPPFLAGS="$CPPFLAGS $libxml_CFLAGS $libqb_CFLAGS"
dnl checks for libraries
AC_CHECK_LIB(aio, io_setup, , missing="yes")
AC_CHECK_LIB(qb, qb_ipcs_connection_auth_set, , missing="yes")
AC_CHECK_LIB(cib, cib_new, , missing="yes")
AC_CHECK_LIB(crmcommon, set_crm_log_level, , missing="yes")
AC_CHECK_LIB(pe_status, pe_find_node, , missing="yes")
AC_CHECK_LIB(pe_rules, test_rule, , missing="yes")
AC_CHECK_LIB(crmcluster, crm_peer_init, , missing="yes")
AC_CHECK_LIB(uuid, uuid_unparse, , missing="yes")
dnl pacemaker >= 1.1.8
AC_CHECK_HEADERS(pacemaker/crm/cluster.h)
AC_CHECK_LIB(crmcommon, pcmk_strerror, , missing="yes")
AC_CHECK_LIB(cib, cib_apply_patch_event, , missing="yes")
if test "$missing" = "yes"; then
AC_MSG_ERROR([Missing required libraries or functions.])
fi
AC_PATH_PROGS(POD2MAN, pod2man, pod2man)
AC_ARG_ENABLE([shared-disk],
[ --enable-shared-disk Turn on functionality that requires shared disk
[default=yes]])
DISK=0
if test "x${enable_shared_disk}" != xno ; then
DISK=1
fi
AC_DEFINE_UNQUOTED(SUPPORT_SHARED_DISK, $DISK, Turn on functionality that requires shared disk)
AM_CONDITIONAL(SUPPORT_SHARED_DISK, test "$DISK" = "1")
if
test -e /proc/$$
then
echo "/proc/{pid} is supported"
AC_DEFINE_UNQUOTED(HAVE_PROC_PID, 1, Define to 1 if /proc/{pid} is supported.)
fi
dnl **********************************************************************
dnl Check for various argv[] replacing functions on various OSs
dnl
dnl Borrowed from Proftpd
dnl Proftpd is Licenced under the terms of the GNU General Public Licence
dnl and is available from http://www.proftpd.org/
dnl
AC_CHECK_FUNCS(setproctitle)
AC_CHECK_HEADERS(libutil.h)
AC_CHECK_LIB(util, setproctitle,
[AC_DEFINE(HAVE_SETPROCTITLE,1,[ ])
ac_cv_func_setproctitle="yes" ; LIBS="$LIBS -lutil"])
if test "$ac_cv_func_setproctitle" = "yes"; then
pf_argv_set="PF_ARGV_NONE"
fi
if test "$pf_argv_set" = ""; then
AC_CHECK_HEADERS(sys/pstat.h)
if test "$ac_cv_header_pstat_h" = "yes"; then
AC_CHECK_FUNCS(pstat)
if test "$ac_cv_func_pstat" = "yes"; then
pf_argv_set="PF_ARGV_PSTAT"
else
pf_argv_set="PF_ARGV_WRITEABLE"
fi
fi
if test "$pf_argv_set" = ""; then
AC_EGREP_HEADER([#define.*PS_STRINGS.*],sys/exec.h,
have_psstrings="yes",have_psstrings="no")
if test "$have_psstrings" = "yes"; then
pf_argv_set="PF_ARGV_PSSTRINGS"
fi
fi
if test "$pf_argv_set" = ""; then
AC_CACHE_CHECK(whether __progname and __progname_full are available,
pf_cv_var_progname,
AC_TRY_LINK([extern char *__progname, *__progname_full;],
[__progname = "foo"; __progname_full = "foo bar";],
pf_cv_var_progname="yes", pf_cv_var_progname="no"))
if test "$pf_cv_var_progname" = "yes"; then
AC_DEFINE(HAVE___PROGNAME,1,[ ])
fi
AC_CACHE_CHECK(which argv replacement method to use,
pf_cv_argv_type,
AC_EGREP_CPP(yes,[
#if defined(__GNU_HURD__)
yes
#endif
],pf_cv_argv_type="new", pf_cv_argv_type="writeable"))
if test "$pf_cv_argv_type" = "new"; then
pf_argv_set="PF_ARGV_NEW"
fi
if test "$pf_argv_set" = ""; then
pf_argv_set="PF_ARGV_WRITEABLE"
fi
fi
fi
AC_DEFINE_UNQUOTED(PF_ARGV_TYPE, $pf_argv_set,
mechanism to pretty-print ps output: setproctitle-equivalent)
dnl End of tests borrowed from Proftpd
AC_MSG_NOTICE(Sanitizing prefix: ${prefix})
case $prefix in
NONE)
prefix=/usr
dnl Fix default variables - "prefix" variable if not specified
if test "$localstatedir" = "\${prefix}/var"; then
localstatedir="/var"
fi
if test "$sysconfdir" = "\${prefix}/etc"; then
sysconfdir="/etc"
fi
;;
esac
AC_MSG_NOTICE(Sanitizing exec_prefix: ${exec_prefix})
case $exec_prefix in
dnl For consistency with Heartbeat, map NONE->$prefix
NONE) exec_prefix=$prefix;;
prefix) exec_prefix=$prefix;;
esac
dnl Expand autoconf variables so that we dont end up with '${prefix}'
dnl in #defines and python scripts
dnl NOTE: Autoconf deliberately leaves them unexpanded to allow
dnl make exec_prefix=/foo install
dnl No longer being able to do this seems like no great loss to me...
eval prefix="`eval echo ${prefix}`"
eval exec_prefix="`eval echo ${exec_prefix}`"
eval bindir="`eval echo ${bindir}`"
eval sbindir="`eval echo ${sbindir}`"
eval libexecdir="`eval echo ${libexecdir}`"
eval datadir="`eval echo ${datadir}`"
eval sysconfdir="`eval echo ${sysconfdir}`"
eval sharedstatedir="`eval echo ${sharedstatedir}`"
eval localstatedir="`eval echo ${localstatedir}`"
eval libdir="`eval echo ${libdir}`"
eval includedir="`eval echo ${includedir}`"
eval oldincludedir="`eval echo ${oldincludedir}`"
eval infodir="`eval echo ${infodir}`"
eval mandir="`eval echo ${mandir}`"
dnl The Makefiles and shell scripts we output
AC_CONFIG_FILES([Makefile src/Makefile agent/Makefile man/Makefile src/sbd.service src/sbd_remote.service])
dnl Now process the entire list of files added by previous
dnl calls to AC_CONFIG_FILES()
AC_OUTPUT()