-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure.ac
102 lines (88 loc) · 2.73 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
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.59])
AC_INIT([pm_logconv-cs], [2.6])
AM_INIT_AUTOMAKE
AC_PREFIX_DEFAULT(/usr)
PM_PKG="pacemaker"
#
# check for python
#
AM_PATH_PYTHON(2.4,,:)
AC_PATH_PROGS(PYTHON, python)
AC_MSG_CHECKING(where is python installed)
if test "x${PYTHON}" = x; then
PYTHON="/usr/bin/env python";
fi
AC_MSG_RESULT(using $PYTHON);
# use when make rpm
AC_SUBST(WITH_LIST, [""])
prefix_orig="$prefix"
prefix=`eval echo "$prefix"`
case $prefix in
NONE) prefix=/usr;;
esac
var(){
case $1 in
*'${'*) res=`eval echo "$1"`;;
*) res="$1";;
esac
case "$res" in
""|NONE) echo "$2";;
*) echo "$res";;
esac
}
#
# Keep copy of original (default) localstatedir
#
localstatedir_orig="$localstatedir"
exec_prefix=`var "$exec_prefix" "$prefix"`
datadir=`var "$datadir" "$prefix/share"`
config_dir=`var "$config_dir" "/etc/"`
AC_ARG_ENABLE([upstart],
[AS_HELP_STRING([--enable-upstart],
[support for the Upstart (default is auto)])],
[],
[enable_upstart=auto]
)
AM_CONDITIONAL(SUPPORT_UPSTART, [test x"${enable_upstart}" = x"yes"])
AC_ARG_ENABLE([systemd],
[AS_HELP_STRING([--enable-systemd],
[support for the Systemd (default is auto)])],
[],
[enable_systemd=auto]
)
AM_CONDITIONAL(SUPPORT_SYSTEMD, [test x"${enable_systemd}" = x"yes"])
AC_CHECK_PROG([UPSTART], [initctl], [yes], [no])
if test "x${UPSTART}" = x"yes"; then
if test "x${enable_upstart}" = x"yes" -o "x${enable_upstart}" = x"auto"; then
WITH_LIST="${WITH_LIST} --with upstart"
PACKAGE_FEATURES="$PACKAGE_FEATURES upstart"
fi
elif test "x${enable_upstart}" = x"yes"; then
AC_MSG_ERROR("Not found initctl")
fi
AC_CHECK_PROG([SYSTEMD], [systemctl], [yes], [no])
if test "x${SYSTEMD}" = x"yes"; then
if test "x${enable_systemd}" = x"yes" -o "x${enable_systemd}" = x"auto"; then
WITH_LIST="${WITH_LIST} --with systemd"
PACKAGE_FEATURES="$PACKAGE_FEATURES systemd"
fi
elif test "x${enable_systemd}" = x"yes"; then
AC_MSG_ERROR("Not found systemctl")
fi
AC_MSG_RESULT([ WITH_LIST = ${WITH_LIST}])
AC_MSG_RESULT([ PACKAGE_FEATURES = ${PACKAGE_FEATURES}])
CONFIG_DIR="$config_dir"
AC_SUBST(CONFIG_DIR)
HA_DATADIR="$datadir"
AC_SUBST(HA_DATADIR)
HA_NOARCHDATAHBDIR="$HA_DATADIR/$PM_PKG"
AC_SUBST(HA_NOARCHDATAHBDIR)
AC_PROG_LN_S
AC_CONFIG_FILES(Makefile \
init/Makefile \
logrotate/Makefile \
sosreport/Makefile
)
AC_OUTPUT